Skip to content

Commit

Permalink
Add number of CPU cores to UMA logs.
Browse files Browse the repository at this point in the history
BUG=463922

Review URL: https://codereview.chromium.org/981363002

Cr-Commit-Position: refs/heads/master@{#320009}
  • Loading branch information
gayane authored and Commit bot committed Mar 11, 2015
1 parent 00a4028 commit f550f50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/metrics/metrics_log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ void MetricsLog::RecordEnvironment(
SystemProfileProto::Hardware::CPU* cpu = hardware->mutable_cpu();
cpu->set_vendor_name(cpu_info.vendor_name());
cpu->set_signature(cpu_info.signature());
cpu->set_num_cores(base::SysInfo::NumberOfProcessors());

std::vector<ActiveGroupId> field_trial_ids;
GetFieldTrialIds(&field_trial_ids);
Expand Down
1 change: 1 addition & 0 deletions components/metrics/metrics_log_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class MetricsLogTest : public testing::Test {
EXPECT_TRUE(hardware.has_cpu());
EXPECT_TRUE(hardware.cpu().has_vendor_name());
EXPECT_TRUE(hardware.cpu().has_signature());
EXPECT_TRUE(hardware.cpu().has_num_cores());

// TODO(isherman): Verify other data written into the protobuf as a result
// of this call.
Expand Down
3 changes: 3 additions & 0 deletions components/metrics/proto/system_profile.proto
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ message SystemProfileProto {

// The signature reported by CPUID (from EAX).
optional uint32 signature = 2;

// Number of logical processors/cores on the current machine.
optional uint32 num_cores = 3;
}
optional CPU cpu = 13;

Expand Down

0 comments on commit f550f50

Please sign in to comment.