mirror of
https://github.com/katanemo/plano.git
synced 2026-05-11 00:32:42 +02:00
Break apart metrics into their own module (#335)
Signed-off-by: José Ulises Niño Rivera <junr03@users.noreply.github.com>
This commit is contained in:
parent
d002b2042a
commit
cd1b561192
9 changed files with 59 additions and 61 deletions
28
crates/llm_gateway/src/metrics.rs
Normal file
28
crates/llm_gateway/src/metrics.rs
Normal file
|
|
@ -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")),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue