use super::PHP_EMBED_METRICS;
pub struct EmbedRequestGuard;
impl EmbedRequestGuard {
pub fn enter() -> Self {
PHP_EMBED_METRICS.request_start();
EmbedRequestGuard
}
}
impl Drop for EmbedRequestGuard {
fn drop(&mut self) {
PHP_EMBED_METRICS.request_end();
}
}
#[inline]
pub fn record_bailout() {
PHP_EMBED_METRICS.bailout();
}
#[inline]
pub fn record_request_bytes(n: u64) {
PHP_EMBED_METRICS.add_request_bytes(n);
}
#[inline]
pub fn record_response_bytes(n: u64) {
PHP_EMBED_METRICS.add_response_bytes(n);
}
#[inline]
pub fn record_thread_spawned() {
PHP_EMBED_METRICS.thread_spawned();
}
#[inline]
pub fn record_thread_exited() {
PHP_EMBED_METRICS.thread_exited();
}
#[inline]
pub fn record_engine_error() {
PHP_EMBED_METRICS.engine_error();
}