2022-12-26 15:03:57 +01:00
|
|
|
module metrics
|
2022-12-26 13:31:50 +01:00
|
|
|
|
|
|
|
fn test_counter_increment() {
|
2022-12-26 15:03:57 +01:00
|
|
|
mut m := new_default_collector()
|
|
|
|
m.counter_register(0, name: 'test')
|
2022-12-26 13:31:50 +01:00
|
|
|
|
2022-12-26 15:03:57 +01:00
|
|
|
m.counter_increment(name: 'test')
|
|
|
|
|
|
|
|
assert m.counter_get(name: 'test')? == u64(1)
|
|
|
|
|
|
|
|
m.counter_increment(name: 'test')
|
|
|
|
|
|
|
|
assert m.counter_get(name: 'test')? == u64(2)
|
2022-12-26 13:31:50 +01:00
|
|
|
}
|