#include "chrome/browser/ui/performance_controls/performance_controls_metrics.h"
#include <memory>
#include "base/check_op.h"
#include "base/location.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/strcat.h"
#include "base/time/time.h"
#include "chrome/browser/performance_manager/public/user_tuning/performance_detection_manager.h"
#include "chrome/common/pref_names.h"
#include "components/metrics/daily_event.h"
#include "components/prefs/pref_service.h"
namespace {
PerformanceDetectionManager;
constexpr base::TimeDelta kDailyEventIntervalTimeDelta = …;
std::string GetDetectionResourceTypeString(
PerformanceDetectionManager::ResourceType resource_type) { … }
class DailyEventObserver : public metrics::DailyEvent::Observer { … };
}
PerformanceInterventionMetricsReporter::PerformanceInterventionMetricsReporter(
PrefService* pref_service)
: … { … }
PerformanceInterventionMetricsReporter::
~PerformanceInterventionMetricsReporter() = default;
void PerformanceInterventionMetricsReporter::RegisterLocalStatePrefs(
PrefRegistrySimple* registry) { … }
void RecordBatterySaverBubbleAction(BatterySaverBubbleActionType type) { … }
void RecordBatterySaverIPHOpenSettings(bool success) { … }
void RecordMemorySaverBubbleAction(MemorySaverBubbleActionType type) { … }
void RecordMemorySaverIPHEnableMode(bool success) { … }
void RecordMemorySaverChipState(MemorySaverChipState state) { … }
void RecordInterventionMessageCount(
PerformanceDetectionManager::ResourceType resource_type,
PrefService* pref_service) { … }
void RecordInterventionRateLimitedCount(
PerformanceDetectionManager::ResourceType resource_type,
PrefService* pref_service) { … }
void RecordInterventionTriggerResult(
PerformanceDetectionManager::ResourceType resource_type,
InterventionMessageTriggerResult reason) { … }
void RecordInterventionToolbarButtonClicked() { … }
void RecordInterventionBubbleClosedReason(
PerformanceDetectionManager::ResourceType resource_type,
InterventionBubbleActionType type) { … }
void RecordCpuHealthStatusAfterDiscard(
base::TimeDelta time_after_discard,
PerformanceDetectionManager::HealthLevel health_level) { … }
void RecordCpuUsageBeforeDiscard(int cpu_usage) { … }
void RecordSuggestedTabShownCount(int count) { … }
void RecordTabRemovedFromTabList(int count_after_removal) { … }
void RecordNumberOfDiscardedTabs(int count) { … }