-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break apart metrics into their own module (#335)
Signed-off-by: José Ulises Niño Rivera <[email protected]>
- Loading branch information
Showing
9 changed files
with
59 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,28 @@ | ||
use common::stats::{Counter, Gauge, Histogram}; | ||
|
||
#[derive(Copy, Clone, Debug)] | ||
pub struct Metrics { | ||
pub active_http_calls: Gauge, | ||
pub ratelimited_rq: Counter, | ||
pub time_to_first_token: Histogram, | ||
pub time_per_output_token: Histogram, | ||
pub tokens_per_second: Histogram, | ||
pub request_latency: Histogram, | ||
pub output_sequence_length: Histogram, | ||
pub input_sequence_length: Histogram, | ||
} | ||
|
||
impl Metrics { | ||
pub fn new() -> Metrics { | ||
Metrics { | ||
active_http_calls: Gauge::new(String::from("active_http_calls")), | ||
ratelimited_rq: Counter::new(String::from("ratelimited_rq")), | ||
time_to_first_token: Histogram::new(String::from("time_to_first_token")), | ||
time_per_output_token: Histogram::new(String::from("time_per_output_token")), | ||
tokens_per_second: Histogram::new(String::from("tokens_per_second")), | ||
request_latency: Histogram::new(String::from("request_latency")), | ||
output_sequence_length: Histogram::new(String::from("output_sequence_length")), | ||
input_sequence_length: Histogram::new(String::from("input_sequence_length")), | ||
} | ||
} | ||
} |
This file contains 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 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 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 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,14 @@ | ||
use common::stats::Gauge; | ||
|
||
#[derive(Copy, Clone, Debug)] | ||
pub struct Metrics { | ||
pub active_http_calls: Gauge, | ||
} | ||
|
||
impl Metrics { | ||
pub fn new() -> Metrics { | ||
Metrics { | ||
active_http_calls: Gauge::new(String::from("active_http_calls")), | ||
} | ||
} | ||
} |
This file contains 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