pub struct NodeInfo {Show 15 fields
pub id: NodeId,
pub hostname: String,
pub ip_address: IpAddr,
pub http_port: u16,
pub grpc_port: u16,
pub roles: Vec<NodeRole>,
pub worker_capabilities: Vec<String>,
pub status: NodeStatus,
pub last_heartbeat: DateTime<Utc>,
pub version: String,
pub started_at: DateTime<Utc>,
pub current_connections: u32,
pub current_jobs: u32,
pub cpu_usage: f32,
pub memory_usage: f32,
}Expand description
Information about a node in the cluster.
Fields§
§id: NodeIdUnique node ID.
hostname: StringHostname.
ip_address: IpAddrIP address.
http_port: u16HTTP port.
grpc_port: u16gRPC port for inter-node communication.
roles: Vec<NodeRole>Enabled roles.
worker_capabilities: Vec<String>Worker capabilities.
status: NodeStatusCurrent status.
last_heartbeat: DateTime<Utc>Last heartbeat time.
version: StringVersion string.
started_at: DateTime<Utc>When the node started.
current_connections: u32Current connection count.
current_jobs: u32Current job count.
cpu_usage: f32CPU usage percentage.
memory_usage: f32Memory usage percentage.
Implementations§
Source§impl NodeInfo
impl NodeInfo
Sourcepub fn new_local(
hostname: String,
ip_address: IpAddr,
http_port: u16,
grpc_port: u16,
roles: Vec<NodeRole>,
worker_capabilities: Vec<String>,
version: String,
) -> Self
pub fn new_local( hostname: String, ip_address: IpAddr, http_port: u16, grpc_port: u16, roles: Vec<NodeRole>, worker_capabilities: Vec<String>, version: String, ) -> Self
Create a new node info for the local node.
Sourcepub fn has_capability(&self, capability: &str) -> bool
pub fn has_capability(&self, capability: &str) -> bool
Check if this node has a specific worker capability.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeInfo
impl RefUnwindSafe for NodeInfo
impl Send for NodeInfo
impl Sync for NodeInfo
impl Unpin for NodeInfo
impl UnwindSafe for NodeInfo
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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