fn form_metric_filename(service_name: &str, with_pid: bool) -> String {
    let dot = ".";
    let separator = "-";
    let mut filename = String::new();
    if service_name.contains(dot) {
        filename = service_name.replace(dot, separator);
    }
    let mut filename = format!("{}{}{}", service_name, separator, METRIC_FILENAME_SUFFIX);
    if with_pid {
        let pid = std::process::id();
        filename = format!("{}.pid{}", filename, pid);
    }
    filename
}
// Generate the metric file name from the service name.
Generate the metric file name from the service name.
Generate the metric file name from the service name .
fn form_metric_filename(service_name: &str, with_pid: bool) -> String {
    let dot = ".";
    let separator = "-";
    let mut filename = String::new();
    if service_name.contains(dot) {
        filename = service_name.replace(dot, separator);
    }
    let mut filename = format!("{}{}{}", service_name, separator, METRIC_FILENAME_SUFFIX);
    if with_pid {
        let pid = std::process::id();
        filename = format!("{}.pid{}", filename, pid);
    }
    filename
}
fn form_metric_filename ( service_name : & str , with_pid : bool ) -> String { let dot = " " ; let separator = " " ; let mut filename = String :: new ( ) ; if service_name . contains ( dot ) { filename = service_name . replace ( dot , separator ) ; } let mut filename = format ! ( " " service_name separator METRIC_FILENAME_SUFFIX ) ; if with_pid { let pid = std :: process :: id ( ) ; filename = format ! ( " " filename pid ) ; } filename }
Generate the metric file name from the service name.
Generate the metric file name from the service name .
service_name
&str
with_pid
bool
service_name
&str
with_pid
bool