pub struct PrometheusService { /* private fields */ }Implementations§
Source§impl PrometheusService
impl PrometheusService
pub fn new(addr: SocketAddr) -> Self
Sourcepub fn port(&self) -> u16
pub fn port(&self) -> u16
Returns the actual port the server is listening on (after start())
Returns 0 if the service hasn’t been started yet.
Sourcepub fn port_accessor(&self) -> Arc<AtomicU16> ⓘ
pub fn port_accessor(&self) -> Arc<AtomicU16> ⓘ
Returns a cloneable accessor for the bound port.
Use this when you need to read the port after the service has been moved into a CamelContext or other container.
Sourcepub fn set_health_checker(
&mut self,
checker: Arc<dyn Fn() -> HealthReport + Send + Sync>,
)
pub fn set_health_checker( &mut self, checker: Arc<dyn Fn() -> HealthReport + Send + Sync>, )
Set the health checker closure that will be called to get system health.
The closure should capture a reference to CamelContext’s health_check method.
Sourcepub fn health_checker(
&self,
) -> Option<Arc<dyn Fn() -> HealthReport + Send + Sync>>
pub fn health_checker( &self, ) -> Option<Arc<dyn Fn() -> HealthReport + Send + Sync>>
Get a clone of the health checker if one is set.
Trait Implementations§
Source§impl Lifecycle for PrometheusService
impl Lifecycle for PrometheusService
Source§fn as_metrics_collector(&self) -> Option<Arc<dyn MetricsCollector>>
fn as_metrics_collector(&self) -> Option<Arc<dyn MetricsCollector>>
Optional: expose MetricsCollector for auto-registration
Source§fn status(&self) -> ServiceStatus
fn status(&self) -> ServiceStatus
Current status of the service.
Auto Trait Implementations§
impl Freeze for PrometheusService
impl !RefUnwindSafe for PrometheusService
impl Send for PrometheusService
impl Sync for PrometheusService
impl Unpin for PrometheusService
impl UnsafeUnpin for PrometheusService
impl !UnwindSafe for PrometheusService
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