Commit ece15b1c authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Remove dead code from performance monitor

This CL should not change any behavior. It's removing some old code
no longer used.

R=oysteine@chromium.org

Change-Id: Icfdbdcc5a5e40d740401ecb9b25536425c4c5e61
Reviewed-on: https://chromium-review.googlesource.com/1178383Reviewed-by: default avataroysteine <oysteine@chromium.org>
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585212}
parent 2a8443a7
...@@ -71,9 +71,9 @@ void GatherMetricsForRenderProcess(content::RenderProcessHost* host, ...@@ -71,9 +71,9 @@ void GatherMetricsForRenderProcess(content::RenderProcessHost* host,
} // namespace } // namespace
PerformanceMonitor::PerformanceMonitor() {} PerformanceMonitor::PerformanceMonitor() = default;
PerformanceMonitor::~PerformanceMonitor() {} PerformanceMonitor::~PerformanceMonitor() = default;
// static // static
PerformanceMonitor* PerformanceMonitor::GetInstance() { PerformanceMonitor* PerformanceMonitor::GetInstance() {
......
...@@ -17,26 +17,13 @@ ...@@ -17,26 +17,13 @@
namespace performance_monitor { namespace performance_monitor {
namespace {
const char kBrowserProcessTrigger[] =
"ProcessMetricsHistory.BrowserProcess.HighCPU";
const char kGPUProcessTrigger[] = "ProcessMetricsHistory.GPUProcess.HighCPU";
const char kExtensionPersistentProcessTrigger[] =
"ProcessMetricsHistory.ExtensionPersistentProcess.HighCPU";
} // namespace
// If a process is consistently above this CPU utilization percentage over time, // If a process is consistently above this CPU utilization percentage over time,
// we consider it as high and may take action. // we consider it as high and may take action.
const float kHighCPUUtilizationThreshold = 90.0f; const float kHighCPUUtilizationThreshold = 90.0f;
ProcessMetricsHistory::ProcessMetricsHistory() ProcessMetricsHistory::ProcessMetricsHistory() = default;
: last_update_sequence_(0), cpu_usage_(0.0), trace_trigger_handle_(-1) {
}
ProcessMetricsHistory::~ProcessMetricsHistory() { ProcessMetricsHistory::~ProcessMetricsHistory() = default;
}
void ProcessMetricsHistory::Initialize( void ProcessMetricsHistory::Initialize(
const ProcessMetricsMetadata& process_data, const ProcessMetricsMetadata& process_data,
...@@ -53,28 +40,6 @@ void ProcessMetricsHistory::Initialize( ...@@ -53,28 +40,6 @@ void ProcessMetricsHistory::Initialize(
process_metrics_ = process_metrics_ =
base::ProcessMetrics::CreateProcessMetrics(process_data_.handle); base::ProcessMetrics::CreateProcessMetrics(process_data_.handle);
#endif #endif
const char* trigger_name = NULL;
switch (process_data_.process_type) {
case content::PROCESS_TYPE_BROWSER:
trigger_name = kBrowserProcessTrigger;
break;
case content::PROCESS_TYPE_GPU:
trigger_name = kGPUProcessTrigger;
break;
}
switch (process_data_.process_subtype) {
case kProcessSubtypeExtensionPersistent:
trigger_name = kExtensionPersistentProcessTrigger;
break;
default:
break;
}
if (trigger_name) {
trace_trigger_handle_ =
content::BackgroundTracingManager::GetInstance()->RegisterTriggerType(
trigger_name);
}
} }
void ProcessMetricsHistory::SampleMetrics() { void ProcessMetricsHistory::SampleMetrics() {
...@@ -196,13 +161,6 @@ void ProcessMetricsHistory::RunPerformanceTriggers() { ...@@ -196,13 +161,6 @@ void ProcessMetricsHistory::RunPerformanceTriggers() {
} }
break; break;
} }
if (cpu_usage_ > kHighCPUUtilizationThreshold &&
trace_trigger_handle_ != -1) {
content::BackgroundTracingManager::GetInstance()->TriggerNamedEvent(
trace_trigger_handle_,
content::BackgroundTracingManager::StartedFinalizingCallback());
}
} }
} // namespace performance_monitor } // namespace performance_monitor
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/process/process_handle.h" #include "base/process/process_handle.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "content/public/browser/background_tracing_manager.h"
#include "content/public/browser/child_process_data.h" #include "content/public/browser/child_process_data.h"
#include "content/public/common/process_type.h" #include "content/public/common/process_type.h"
...@@ -66,19 +65,17 @@ class ProcessMetricsHistory { ...@@ -66,19 +65,17 @@ class ProcessMetricsHistory {
// renderer processes. // renderer processes.
ProcessMetricsMetadata process_data_; ProcessMetricsMetadata process_data_;
std::unique_ptr<base::ProcessMetrics> process_metrics_; std::unique_ptr<base::ProcessMetrics> process_metrics_;
int last_update_sequence_; int last_update_sequence_ = 0;
double cpu_usage_; double cpu_usage_ = 0.0;
#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX) #if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_AIX)
int idle_wakeups_; int idle_wakeups_ = 0;
#endif #endif
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
int package_idle_wakeups_; int package_idle_wakeups_ = 0;
#endif #endif
content::BackgroundTracingManager::TriggerHandle trace_trigger_handle_;
DISALLOW_ASSIGN(ProcessMetricsHistory); DISALLOW_ASSIGN(ProcessMetricsHistory);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment