Skip to content

Commit

Permalink
[battery] Deprecate BatterySamplingDelay
Browse files Browse the repository at this point in the history
Bug: 1421844
Change-Id: I0cb28da275c587e54bd84acef72989c6392adde6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4343935
Reviewed-by: Olivier Li <olivierli@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1118305}
  • Loading branch information
Etienne Pierre-doray authored and Chromium LUCI CQ committed Mar 16, 2023
1 parent 6bb1c78 commit c9b70a0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
12 changes: 1 addition & 11 deletions chrome/browser/metrics/power/power_metrics_reporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@

namespace {

constexpr const char* kBatterySamplingDelayHistogramName =
"Power.BatterySamplingDelay";

// Calculates the UKM bucket |value| falls in and returns it. This uses an
// exponential bucketing approach with an exponent base of 1.3, resulting in
// 17 buckets for an interval of 120 seconds.
Expand Down Expand Up @@ -203,8 +200,7 @@ void PowerMetricsReporter::OnAggregatedMetricsSampled(
// |battery_level_provider_|.
battery_level_provider_->GetBatteryState(base::BindOnce(
&PowerMetricsReporter::OnBatteryAndAggregatedProcessMetricsSampled,
base::Unretained(this), metrics, interval_duration,
/*battery_sample_begin_time=*/now));
base::Unretained(this), metrics, interval_duration));
} else {
// Get usage scenario data.
auto long_interval_data =
Expand All @@ -216,17 +212,11 @@ void PowerMetricsReporter::OnAggregatedMetricsSampled(
void PowerMetricsReporter::OnBatteryAndAggregatedProcessMetricsSampled(
const ProcessMonitor::Metrics& aggregated_process_metrics,
base::TimeDelta interval_duration,
base::TimeTicks battery_sample_begin_time,
const absl::optional<base::BatteryLevelProvider::BatteryState>&
new_battery_state) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(battery_level_provider_);

// Report time it took to sample the battery state.
base::UmaHistogramMicrosecondsTimes(
kBatterySamplingDelayHistogramName,
base::TimeTicks::Now() - battery_sample_begin_time);

// Evaluate battery discharge mode and rate.
auto previous_battery_state =
std::exchange(battery_state_, new_battery_state);
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/metrics/power/power_metrics_reporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class PowerMetricsReporter : public ProcessMonitor::Observer {
void OnBatteryAndAggregatedProcessMetricsSampled(
const ProcessMonitor::Metrics& aggregated_process_metrics,
base::TimeDelta interval_duration,
base::TimeTicks battery_sample_begin_time,
const absl::optional<base::BatteryLevelProvider::BatteryState>&
new_battery_state);

Expand Down
11 changes: 0 additions & 11 deletions tools/metrics/histograms/metadata/power/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1145,17 +1145,6 @@ chromium-metrics-reviews@google.com.
</summary>
</histogram>

<histogram name="Power.BatterySamplingDelay" units="microseconds"
expires_after="2023-04-16">
<owner>etiennep@chromium.org</owner>
<owner>fdoray@chromium.org</owner>
<summary>
The delay in microseconds between the time a battery charge level query was
schedule and the time the state is made available, reported everytime the
battery charge level is sampled. Reported for all users on Windows and Mac.
</summary>
</histogram>

<histogram name="Power.BitfixChunks" units="units" expires_after="M77">
<owner>dianders@chromium.org</owner>
<summary>
Expand Down

0 comments on commit c9b70a0

Please sign in to comment.