fn log_throttle_end_with_result(&self, result: thermal_limit_result, timestamp: Nanoseconds) {
        let mut data = self.inner.lock();

        if let Some(time) = data.throttle_start_time.take() {
            let elapsed_time = timestamp - time;
            if elapsed_time >= Nanoseconds(0) {
                data.cobalt_sender.log_elapsed_time(
                    power_metrics_registry::THERMAL_LIMITING_ELAPSED_TIME_METRIC_ID,
                    (),
                    Microseconds::from(elapsed_time).0,
                );
            } else {
                debug_assert!(false, "Elapsed time must not be negative");
            }
        }

        data.cobalt_sender
            .log_event(power_metrics_registry::THERMAL_LIMIT_RESULT_METRIC_ID, vec![result as u32]);
    }
/// Log the end of a thermal throttling duration with a specified reason. To track the elapsed
/// time of a throttling event, it is expected that `log_throttle_start` is called first.
/// However, this is not strictly enforced because of a special case described in
/// `log_throttle_end_shutdown`.
Log the end of a thermal throttling duration with a specified reason. To track the elapsed
time of a throttling event, it is expected that `log_throttle_start` is called first.
However, this is not strictly enforced because of a special case described in
`log_throttle_end_shutdown`.
Log the end of a thermal throttling duration with a specified reason . To track the elapsed time of a throttling event it is expected that ` log_throttle_start ` is called first . However this is not strictly enforced because of a special case described in ` log_throttle_end_shutdown ` .
fn log_throttle_end_with_result(&self, result: thermal_limit_result, timestamp: Nanoseconds) {
        let mut data = self.inner.lock();
        if let Some(time) = data.throttle_start_time.take() {
            let elapsed_time = timestamp - time;
            if elapsed_time >= Nanoseconds(0) {
                data.cobalt_sender.log_elapsed_time(
                    power_metrics_registry::THERMAL_LIMITING_ELAPSED_TIME_METRIC_ID,
                    (),
                    Microseconds::from(elapsed_time).0,
                );
            } else {
                debug_assert!(false, "Elapsed time must not be negative");
            }
        }
        data.cobalt_sender
            .log_event(power_metrics_registry::THERMAL_LIMIT_RESULT_METRIC_ID, vec![result as u32]);
    }
fn log_throttle_end_with_result ( & self , result : thermal_limit_result , timestamp : Nanoseconds ) { let mut data = self . inner . lock ( ) ; if let Some ( time ) = data . throttle_start_time . take ( ) { let elapsed_time = timestamp - time ; if elapsed_time >= Nanoseconds ( 0 ) { data . cobalt_sender . log_elapsed_time ( power_metrics_registry :: THERMAL_LIMITING_ELAPSED_TIME_METRIC_ID , ( ) , Microseconds :: from ( elapsed_time ) . 0 , ) ; } else { debug_assert ! ( false " " ) ; } } data . cobalt_sender . log_event ( power_metrics_registry :: THERMAL_LIMIT_RESULT_METRIC_ID , vec ! [ result as u32 ] ) ; }
Log the end of a thermal throttling duration with a specified reason.
Log the end of a thermal throttling duration with a specified reason .
&self
result
thermal_limit_result
timestamp
Nanoseconds
&self
result
thermal_limit_result
timestamp
Nanoseconds