pub struct ProcessStatus {Show 13 fields
pub id: ProcessId,
pub name: String,
pub state: ProcessState,
pub pid: Option<u32>,
pub uptime: Option<DateTime<Utc>>,
pub restarts: u32,
pub cpu_usage: f32,
pub memory_usage: u64,
pub exit_code: Option<i32>,
pub error: Option<String>,
pub namespace: String,
pub instance: Option<u32>,
pub assigned_port: Option<u16>,
}Expand description
Process status information for external consumption.
This struct represents the current status and metrics of a managed process. It’s designed to be serializable for API responses and contains all the information needed for monitoring and display purposes.
§Examples
use pmdaemon::process::{ProcessStatus, ProcessState};
use uuid::Uuid;
// ProcessStatus is typically obtained from Process::status()
// This example shows the structure for documentation purposes
let status = ProcessStatus {
id: Uuid::new_v4(),
name: "my-app".to_string(),
state: ProcessState::Online,
pid: Some(1234),
uptime: None,
restarts: 0,
cpu_usage: 15.5,
memory_usage: 128 * 1024 * 1024, // 128MB
exit_code: None,
error: None,
namespace: "default".to_string(),
instance: None,
assigned_port: Some(3000),
};Fields§
§id: ProcessIdUnique process identifier (UUID)
name: StringHuman-readable process name
state: ProcessStateCurrent process state (starting, online, stopped, etc.)
pid: Option<u32>System process ID (PID) if the process is currently running
uptime: Option<DateTime<Utc>>Process start time (UTC) for uptime calculation
restarts: u32Total number of times this process has been restarted
cpu_usage: f32Current CPU usage as a percentage (0.0-100.0)
memory_usage: u64Current memory usage in bytes
exit_code: Option<i32>Exit code from the last process termination
error: Option<String>Error message if the process is in an error state
namespace: StringNamespace for logical process grouping
instance: Option<u32>Instance number for cluster mode (0-based)
assigned_port: Option<u16>Port assigned to this process (if any)
Trait Implementations§
Source§impl Clone for ProcessStatus
impl Clone for ProcessStatus
Source§fn clone(&self) -> ProcessStatus
fn clone(&self) -> ProcessStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProcessStatus
impl Debug for ProcessStatus
Source§impl<'de> Deserialize<'de> for ProcessStatus
impl<'de> Deserialize<'de> for ProcessStatus
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ProcessStatus
impl RefUnwindSafe for ProcessStatus
impl Send for ProcessStatus
impl Sync for ProcessStatus
impl Unpin for ProcessStatus
impl UnwindSafe for ProcessStatus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more