You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: services.rs
    path of file: ./repos/fuel-core/crates/metrics/src
    
    the code of the file until where you have to start completion: use prometheus_client::{
    encoding::text::encode,
    metrics::counter::Counter,
    registry::Registry,
};
use std::{
    ops::Deref,
    sync::{
        Mutex,
        OnceLock,
    },
};

/// The statistic of the service life cycle.
#[derive(Default, Debug)]
pub struct ServiceLifecycle {
    /// The time spent for real actions by the service.
    ///
    /// Time is in nanoseconds.
    // TODO: Use `AtomicU128` when it is stable, otherwise, the field can overflow at some point.
    pub busy: Counter,
    /// The idle time of awaiting 
    
    pub fn register_service(&self, service_name: &str) -> ServiceLifecycle {
        let reg =
            regex::Regex::new("^[a-zA-Z_:][a-zA-Z0-9_:]*$").expect("It is a valid Regex");
        if !reg.is_match(service_name) {
            panic!("The service {} has incorrect name.", service_name);
        }
        let lifecycle = ServiceLifecycle::default();
        let mut lock = self
            .registry
            .lock()
            .expect("The lock of the service metric is poisoned");

        // Check that it is a unique service.
        let mut encoded_bytes = String::new();
        encode(&mut encoded_bytes, lock.deref())
            .expect("Unable to decode service metrics");

        let reg = regex::Regex::new(format!("\\b{}\\b", service_name).as_str())
            .expect("It is a valid Regex");
        if reg.is_match(encoded_bytes.as_str()) {
            tracing::warn!("Service with '{}' name is already registered", service_name);
        }

        lock.register(
            format!("{}_idle_ns", service_name),
            format!("The idle time of the {} service", service_name),
            lifecycle.idle.clone(),
        );
        lock.register(
            format!("{}_busy_ns", service_name),
            format!("The busy time of the {} service", service_name),
            lifecycle.busy.clone(),
        );

        lifecycle
    }