-
Notifications
You must be signed in to change notification settings - Fork 269
More improvements to studio2 publishing #2333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
03ed195
feat: start to add more dashboard queries
seawatts e053a41
types
aaronvg 4a84bd2
dashboard types
aaronvg 864ef02
Fix client details not appearing for streams
aaronvg f090ef8
Merge remote-tracking branch 'origin/canary' into aug-14-studio
aaronvg ba1a717
Fix client details test, and fix api key name
aaronvg 439f537
llm only filter
aaronvg 2fdda5d
add new api to get http data
aaronvg 869e45e
actually add api
aaronvg b51bafb
Merge branch 'canary' into aug-14-studio
aaronvg df0ed86
cargo fmt
aaronvg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
use baml_ids::ProjectId; | ||
use serde::{Deserialize, Serialize}; | ||
use ts_rs::TS; | ||
|
||
use crate::{base::EpochMsTimestamp, rpc::ApiEndpoint}; | ||
|
||
#[derive(Debug, Serialize, Deserialize, TS)] | ||
#[ts(export)] | ||
pub struct GetCostStatsRequest { | ||
#[ts(type = "string")] | ||
pub project_id: ProjectId, | ||
#[ts(type = "FilterExpression<number>", optional)] | ||
pub start_time: | ||
Option<super::ui_function_calls::FilterExpression<crate::base::EpochMsTimestamp>>, | ||
#[ts(type = "FilterExpression<number>", optional)] | ||
pub end_time: Option<super::ui_function_calls::FilterExpression<crate::base::EpochMsTimestamp>>, | ||
#[ts(optional)] | ||
pub relative_time: Option<super::ui_function_calls::RelativeTime>, | ||
#[ts(optional)] | ||
pub function_name: Option<super::ui_function_calls::FilterExpression<String>>, | ||
#[ts(optional)] | ||
pub status: Option< | ||
super::ui_function_calls::FilterExpression<super::ui_function_calls::FunctionCallStatus>, | ||
>, | ||
#[ts(optional)] | ||
pub tags: Option<Vec<super::ui_function_calls::TagFilter>>, | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize, TS)] | ||
#[ts(export)] | ||
pub struct TimeSeriesFloatPoint { | ||
#[ts(type = "number")] | ||
pub interval_start: EpochMsTimestamp, | ||
pub value: f64, | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize, TS)] | ||
#[ts(export)] | ||
pub struct MetricSeriesFloat { | ||
pub total: f64, | ||
pub series: Vec<TimeSeriesFloatPoint>, | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize, TS)] | ||
#[ts(export)] | ||
pub struct CostByClientBreakdownItem { | ||
pub client_name: String, | ||
pub total_cost: f64, | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize, TS)] | ||
#[ts(export)] | ||
pub struct GetCostStatsResponse { | ||
pub total_cost: MetricSeriesFloat, | ||
pub cost_by_client: Vec<CostByClientBreakdownItem>, | ||
} | ||
|
||
pub struct GetCostStats; | ||
|
||
impl ApiEndpoint for GetCostStats { | ||
type Request<'a> = GetCostStatsRequest; | ||
type Response<'a> = GetCostStatsResponse; | ||
|
||
const PATH: &'static str = "/v1/dashboard/cost"; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use ts_rs::TS; | ||
|
||
use super::ui_types::UiHttpCall; | ||
use crate::{rpc::ApiEndpoint, FunctionCallId, ProjectId}; | ||
|
||
#[derive(Debug, Serialize, Deserialize, TS)] | ||
#[ts(export)] | ||
pub struct GetFunctionCallHttpCallsRequest { | ||
#[ts(type = "string")] | ||
pub project_id: ProjectId, | ||
#[ts(type = "string")] | ||
pub function_call_id: FunctionCallId, | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize, TS)] | ||
#[ts(export)] | ||
pub struct GetFunctionCallHttpCallsResponse { | ||
pub http_calls: Vec<UiHttpCall>, | ||
} | ||
|
||
pub struct GetFunctionCallHttpCalls; | ||
|
||
impl ApiEndpoint for GetFunctionCallHttpCalls { | ||
type Request<'a> = GetFunctionCallHttpCallsRequest; | ||
type Response<'a> = GetFunctionCallHttpCallsResponse; | ||
|
||
const PATH: &'static str = "/v1/function-calls/http-calls"; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New time series and metric types (TimeSeriesFloatPoint, TimeSeriesIntPoint, MetricSeriesFloat, MetricSeriesInt) are defined here. These are duplicated in ui_dashboard_cost. Consider extracting shared types to a common module to reduce code duplication.