1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::time::Instant;

use metrics::gauge;
use vector_lib::internal_event::InternalEvent;

#[derive(Debug)]
pub struct Heartbeat {
    pub since: Instant,
}

impl InternalEvent for Heartbeat {
    fn emit(self) {
        trace!(target: "vector", message = "Beep.");
        gauge!("uptime_seconds").set(self.since.elapsed().as_secs() as f64);
    }
}