use opentelemetry::Context;
use opentelemetry::KeyValue;
#[derive(Debug, Default, Clone, Copy)]
pub struct NopLongCounter;
impl NopLongCounter {
#[inline]
pub fn new() -> Self {
Self
}
#[inline]
pub fn add(&self, _value: i64) {
}
#[inline]
pub fn add_with_attributes(&self, _value: i64, _attributes: &[KeyValue]) {
}
#[inline]
pub fn add_with_context(&self, _value: i64, _attributes: &[KeyValue], _context: &Context) {
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_nop_long_counter_default() {
let counter = NopLongCounter;
counter.add(100);
}
#[test]
fn test_nop_long_counter_new() {
let counter = NopLongCounter::new();
counter.add(100);
}
#[test]
fn test_nop_long_counter_add_with_attributes() {
let counter = NopLongCounter::new();
let attributes = [KeyValue::new("key", "value")];
counter.add_with_attributes(100, &attributes);
}
#[test]
fn test_nop_long_counter_add_with_context() {
let counter = NopLongCounter::new();
let attributes = [KeyValue::new("key", "value")];
let context = Context::current();
counter.add_with_context(100, &attributes, &context);
}
}