@@ -3,7 +3,7 @@ use crate::experiments::{Assignee, Experiment};
3
3
use crate :: prelude:: * ;
4
4
use crate :: server:: agents:: Agent ;
5
5
use chrono:: { DateTime , Utc } ;
6
- use prometheus:: { HistogramVec , IntCounter , IntCounterVec , IntGauge , IntGaugeVec } ;
6
+ use prometheus:: { Histogram , HistogramVec , IntCounter , IntCounterVec , IntGauge , IntGaugeVec } ;
7
7
8
8
const JOBS_METRIC : & str = "crater_completed_jobs_total" ;
9
9
const AGENT_WORK_METRIC : & str = "crater_agent_supposed_to_work" ;
@@ -21,6 +21,7 @@ pub struct Metrics {
21
21
crater_last_crates_update : IntGauge ,
22
22
pub crater_endpoint_time : HistogramVec ,
23
23
crater_worker_count : IntGauge ,
24
+ pub result_log_size : Histogram ,
24
25
}
25
26
26
27
impl Metrics {
@@ -47,6 +48,11 @@ impl Metrics {
47
48
. buckets( prometheus:: exponential_buckets( 0.05 , 1.2 , 25 ) . unwrap( ) ) ,
48
49
& [ "endpoint" ]
49
50
) ?;
51
+ let result_log_size = prometheus:: register_histogram!(
52
+ "crater_log_length" ,
53
+ "payload size in bytes" ,
54
+ prometheus:: exponential_buckets( 4096.0 , 1.28 , 30 ) ?
55
+ ) ?;
50
56
51
57
let crater_worker_count = prometheus:: opts!( WORKER_COUNT , "number of active workers" ) ;
52
58
let crater_worker_count = prometheus:: register_int_gauge!( crater_worker_count) ?;
@@ -59,6 +65,7 @@ impl Metrics {
59
65
crater_last_crates_update,
60
66
crater_endpoint_time,
61
67
crater_worker_count,
68
+ result_log_size,
62
69
} )
63
70
}
64
71
0 commit comments