Loading metricsd/uploader/metrics_log.cc +2 −2 Original line number Diff line number Diff line Loading @@ -48,6 +48,6 @@ void MetricsLog::IncrementUncleanShutdownCount() { stability->set_unclean_system_shutdown_count(current + 1); } void MetricsLog::PopulateSystemProfile(SystemProfileSetter* profile_setter) { profile_setter->Populate(uma_proto()); bool MetricsLog::PopulateSystemProfile(SystemProfileSetter* profile_setter) { return profile_setter->Populate(uma_proto()); } metricsd/uploader/metrics_log.h +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ class MetricsLog : public metrics::MetricsLogBase { void IncrementUncleanShutdownCount(); // Populate the system profile with system information using setter. void PopulateSystemProfile(SystemProfileSetter* setter); bool PopulateSystemProfile(SystemProfileSetter* setter); private: FRIEND_TEST(UploadServiceTest, LogContainsAggregatedValues); Loading metricsd/uploader/system_profile_cache.cc +7 −4 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ bool SystemProfileCache::Initialize() { if (!base::SysInfo::GetLsbReleaseValue("BRILLO_BUILD_TARGET_ID", &profile_.build_target_id)) { LOG(ERROR) << "Could not initialize system profile."; LOG(ERROR) << "BRILLO_BUILD_TARGET_ID is not set in /etc/lsb-release."; return false; } Loading Loading @@ -109,11 +109,12 @@ bool SystemProfileCache::InitializeOrCheck() { return initialized_ || Initialize(); } void SystemProfileCache::Populate( bool SystemProfileCache::Populate( metrics::ChromeUserMetricsExtension* metrics_proto) { CHECK(metrics_proto); CHECK(InitializeOrCheck()) << "failed to initialize system information."; if (not InitializeOrCheck()) { return false; } // The client id is hashed before being sent. metrics_proto->set_client_id( Loading @@ -132,6 +133,8 @@ void SystemProfileCache::Populate( metrics::SystemProfileProto_BrilloDeviceData* device_data = profile_proto->mutable_brillo(); device_data->set_build_target_id(profile_.build_target_id); return true; } std::string SystemProfileCache::GetPersistentGUID( Loading metricsd/uploader/system_profile_cache.h +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ class SystemProfileCache : public SystemProfileSetter { SystemProfileCache(bool testing, const std::string& config_root); // Populates the ProfileSystem protobuf with system information. void Populate(metrics::ChromeUserMetricsExtension* metrics_proto) override; bool Populate(metrics::ChromeUserMetricsExtension* metrics_proto) override; // Converts a string representation of the channel to a // SystemProfileProto_Channel Loading metricsd/uploader/system_profile_setter.h +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ class SystemProfileSetter { public: virtual ~SystemProfileSetter() {} // Populates the protobuf with system informations. virtual void Populate(metrics::ChromeUserMetricsExtension* profile_proto) = 0; virtual bool Populate(metrics::ChromeUserMetricsExtension* profile_proto) = 0; }; #endif // METRICS_UPLOADER_SYSTEM_PROFILE_SETTER_H_ Loading
metricsd/uploader/metrics_log.cc +2 −2 Original line number Diff line number Diff line Loading @@ -48,6 +48,6 @@ void MetricsLog::IncrementUncleanShutdownCount() { stability->set_unclean_system_shutdown_count(current + 1); } void MetricsLog::PopulateSystemProfile(SystemProfileSetter* profile_setter) { profile_setter->Populate(uma_proto()); bool MetricsLog::PopulateSystemProfile(SystemProfileSetter* profile_setter) { return profile_setter->Populate(uma_proto()); }
metricsd/uploader/metrics_log.h +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ class MetricsLog : public metrics::MetricsLogBase { void IncrementUncleanShutdownCount(); // Populate the system profile with system information using setter. void PopulateSystemProfile(SystemProfileSetter* setter); bool PopulateSystemProfile(SystemProfileSetter* setter); private: FRIEND_TEST(UploadServiceTest, LogContainsAggregatedValues); Loading
metricsd/uploader/system_profile_cache.cc +7 −4 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ bool SystemProfileCache::Initialize() { if (!base::SysInfo::GetLsbReleaseValue("BRILLO_BUILD_TARGET_ID", &profile_.build_target_id)) { LOG(ERROR) << "Could not initialize system profile."; LOG(ERROR) << "BRILLO_BUILD_TARGET_ID is not set in /etc/lsb-release."; return false; } Loading Loading @@ -109,11 +109,12 @@ bool SystemProfileCache::InitializeOrCheck() { return initialized_ || Initialize(); } void SystemProfileCache::Populate( bool SystemProfileCache::Populate( metrics::ChromeUserMetricsExtension* metrics_proto) { CHECK(metrics_proto); CHECK(InitializeOrCheck()) << "failed to initialize system information."; if (not InitializeOrCheck()) { return false; } // The client id is hashed before being sent. metrics_proto->set_client_id( Loading @@ -132,6 +133,8 @@ void SystemProfileCache::Populate( metrics::SystemProfileProto_BrilloDeviceData* device_data = profile_proto->mutable_brillo(); device_data->set_build_target_id(profile_.build_target_id); return true; } std::string SystemProfileCache::GetPersistentGUID( Loading
metricsd/uploader/system_profile_cache.h +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ class SystemProfileCache : public SystemProfileSetter { SystemProfileCache(bool testing, const std::string& config_root); // Populates the ProfileSystem protobuf with system information. void Populate(metrics::ChromeUserMetricsExtension* metrics_proto) override; bool Populate(metrics::ChromeUserMetricsExtension* metrics_proto) override; // Converts a string representation of the channel to a // SystemProfileProto_Channel Loading
metricsd/uploader/system_profile_setter.h +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ class SystemProfileSetter { public: virtual ~SystemProfileSetter() {} // Populates the protobuf with system informations. virtual void Populate(metrics::ChromeUserMetricsExtension* profile_proto) = 0; virtual bool Populate(metrics::ChromeUserMetricsExtension* profile_proto) = 0; }; #endif // METRICS_UPLOADER_SYSTEM_PROFILE_SETTER_H_