Skip to main content

microsandbox_protocol/
heartbeat.rs

1//! Heartbeat data for the guest agent.
2
3use chrono::{DateTime, Utc};
4use serde::{Deserialize, Serialize};
5
6//--------------------------------------------------------------------------------------------------
7// Types
8//--------------------------------------------------------------------------------------------------
9
10/// Heartbeat data written to `/.msb/heartbeat.json` inside the guest.
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct Heartbeat {
13    /// Timestamp of this heartbeat.
14    pub timestamp: DateTime<Utc>,
15
16    /// Number of currently active exec sessions.
17    pub active_sessions: u32,
18
19    /// Timestamp of the last message received from the host.
20    pub last_activity: DateTime<Utc>,
21}