serialize sbot stat struct
This commit is contained in:
parent
51eff6a298
commit
de9b8f5d73
|
@ -2,19 +2,27 @@
|
||||||
|
|
||||||
use std::{process::Command, str};
|
use std::{process::Command, str};
|
||||||
|
|
||||||
|
#[cfg(feature = "miniserde_support")]
|
||||||
|
use miniserde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[cfg(feature = "serde_support")]
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::StatsError;
|
use crate::StatsError;
|
||||||
|
|
||||||
/// go-sbot process statistics.
|
/// go-sbot process statistics.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[cfg_attr(feature = "miniserde_support", derive(Serialize, Deserialize))]
|
||||||
|
#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))]
|
||||||
pub struct SbotStat {
|
pub struct SbotStat {
|
||||||
/// Current process state.
|
/// Current process state.
|
||||||
state: String,
|
pub state: String,
|
||||||
/// Current process memory usage in bytes.
|
/// Current process memory usage in bytes.
|
||||||
memory: Option<u32>,
|
pub memory: Option<u32>,
|
||||||
/// Uptime for the process (if state is `active`).
|
/// Uptime for the process (if state is `active`).
|
||||||
uptime: Option<String>,
|
pub uptime: Option<String>,
|
||||||
/// Downtime for the process (if state is `inactive`).
|
/// Downtime for the process (if state is `inactive`).
|
||||||
downtime: Option<String>,
|
pub downtime: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SbotStat {
|
impl SbotStat {
|
||||||
|
|
Loading…
Reference in New Issue