INNER CODE UNIT · Rust

is_metrics_configured

rustic-rs/rustic · src/config.rs:284

    pub fn is_metrics_configured(&self) -> bool {
        self.prometheus.is_some() || self.opentelemetry.is_some()
    }

    pub fn format_timestamp(&self, timestamp: Timestamp) -> String {
        self.format_time(&timestamp.to_zoned(TimeZone::UTC))
            .to_string()
    }

    pub fn format_time(&self, time: &Zoned) -> impl Display {
        if self.show_time_offset {
            time.strftime("%Y-%m-%d %H:%M:%S%z")
        } else {
            let tz = TimeZone::system();
            if time.offset() == tz.to_offset(time.timestamp()) {
                time.strftime("%Y-%m-%d %H:%M:%S")
            } else {
                time.with_time_zone(tz).strftime("%Y-%m-%d %H:%M:%S*")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…