fix: add buckets_set function to interface
parent
bf1385ee6d
commit
ae2eeeb974
|
@ -23,6 +23,7 @@ pub interface MetricsCollector {
|
|||
mut:
|
||||
counter_set(val u64, metric Metric)
|
||||
counter_increment(metric Metric)
|
||||
histogram_buckets_set(name string, buckets []f64)
|
||||
histogram_record(value f64, metric Metric)
|
||||
gauge_set(value f64, metric Metric)
|
||||
gauge_add(value f64, metric Metric)
|
||||
|
|
2
null.v
2
null.v
|
@ -19,6 +19,8 @@ pub fn (c &NullCollector) counters() []Metric {
|
|||
return []
|
||||
}
|
||||
|
||||
pub fn (mut c DefaultCollector) histogram_buckets_set(name string, buckets []f64) {}
|
||||
|
||||
pub fn (c &NullCollector) histogram_record(value f64, metric Metric) {}
|
||||
|
||||
pub fn (c &NullCollector) histogram_get(metric Metric) ?Histogram {
|
||||
|
|
|
@ -40,7 +40,7 @@ fn test_only_gauges() {
|
|||
fn test_single_histogram() {
|
||||
mut m := new_default_collector()
|
||||
|
||||
m.histogram_buckets_set('test', [0.5, 5.0])
|
||||
m.histogram_buckets_set('test', [0.5, 5.0])
|
||||
m.histogram_record(5.0, name: 'test')
|
||||
m.histogram_record(7.0, name: 'test')
|
||||
|
||||
|
|
Loading…
Reference in New Issue