Struct prima_datadog::Datadog
source · [−]pub struct Datadog { /* private fields */ }Expand description
The Datadog struct is the main entry point for the library
Implementations
sourceimpl Datadog
impl Datadog
sourcepub fn init(configuration: impl Configuration) -> Result<(), Error>
pub fn init(configuration: impl Configuration) -> Result<(), Error>
Initializes a Datadog instance with a struct that implements the Configuration trait. Make sure that you run it only once otherwise you will get an error.
sourcepub fn new(
client: impl 'static + DogstatsdClient + Send + Sync,
is_reporting_enabled: bool
) -> Self
pub fn new(
client: impl 'static + DogstatsdClient + Send + Sync,
is_reporting_enabled: bool
) -> Self
initialize a Datadog instance with bare parameters. This should be used carefully. Use Datadog::init instead
pub fn global() -> &'static Datadog
pub fn is_reporting_enabled(&self) -> bool
sourcepub fn incr(
&self,
metric: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
pub fn incr(
&self,
metric: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
Increment a StatsD counter
sourcepub fn decr(
&self,
metric: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
pub fn decr(
&self,
metric: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
Decrement a StatsD counter
sourcepub fn count(
&self,
metric: impl AsRef<str>,
count: i64,
tags: impl IntoIterator<Item = String>
)
pub fn count(
&self,
metric: impl AsRef<str>,
count: i64,
tags: impl IntoIterator<Item = String>
)
Make an arbitrary change to a StatsD counter
sourcepub fn time(
&self,
metric: impl AsRef<str>,
tags: impl IntoIterator<Item = String>,
block: impl FnOnce() + 'static
)
pub fn time(
&self,
metric: impl AsRef<str>,
tags: impl IntoIterator<Item = String>,
block: impl FnOnce() + 'static
)
Time a block of code (reports in ms)
sourcepub fn timing(
&self,
metric: impl AsRef<str>,
ms: i64,
tags: impl IntoIterator<Item = String>
)
pub fn timing(
&self,
metric: impl AsRef<str>,
ms: i64,
tags: impl IntoIterator<Item = String>
)
Send your own timing metric in milliseconds
sourcepub fn gauge(
&self,
metric: impl AsRef<str>,
value: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
pub fn gauge(
&self,
metric: impl AsRef<str>,
value: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
Report an arbitrary value as a gauge
sourcepub fn histogram(
&self,
metric: impl AsRef<str>,
value: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
pub fn histogram(
&self,
metric: impl AsRef<str>,
value: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
Report a value in a histogram
sourcepub fn distribution(
&self,
metric: impl AsRef<str>,
value: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
pub fn distribution(
&self,
metric: impl AsRef<str>,
value: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
Report a value in a distribution
sourcepub fn set(
&self,
metric: impl AsRef<str>,
value: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
pub fn set(
&self,
metric: impl AsRef<str>,
value: impl AsRef<str>,
tags: impl IntoIterator<Item = String>
)
Report a value in a set
sourcepub fn service_check(
&self,
metric: impl AsRef<str>,
value: ServiceStatus,
tags: impl IntoIterator<Item = String>,
options: Option<ServiceCheckOptions>
)
pub fn service_check(
&self,
metric: impl AsRef<str>,
value: ServiceStatus,
tags: impl IntoIterator<Item = String>,
options: Option<ServiceCheckOptions>
)
Report the status of a service
Auto Trait Implementations
impl !RefUnwindSafe for Datadog
impl Send for Datadog
impl Sync for Datadog
impl Unpin for Datadog
impl !UnwindSafe for Datadog
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more