Loading metricsd/constants.h +4 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,10 @@ static const char kDefaultVersion[] = "0.0.0.0"; // Build time properties name. static const char kProductId[] = "product_id"; static const char kProductVersion[] = "product_version"; // Weave configuration. static const char kWeaveConfigurationFile[] = "/system/etc/weaved/weaved.conf"; static const char kModelManifestId[] = "model_id"; } // namespace metrics #endif // METRICS_CONSTANTS_H_ metricsd/uploader/system_profile_cache.cc +13 −2 Original line number Diff line number Diff line Loading @@ -108,7 +108,18 @@ bool SystemProfileCache::Initialize() { profile_.client_id = testing_ ? "client_id_test" : GetPersistentGUID(guid_path); profile_.hardware_class = "unknown"; profile_.model_manifest_id = "unknown"; if (!testing_) { brillo::KeyValueStore weave_config; if (!weave_config.Load(base::FilePath(metrics::kWeaveConfigurationFile))) { LOG(ERROR) << "Failed to load the weave configuration file."; } else if (!weave_config.GetString(metrics::kModelManifestId, &profile_.model_manifest_id)) { LOG(ERROR) << "The model manifest id (model_id) is undefined in " << metrics::kWeaveConfigurationFile; } } profile_.channel = ProtoChannelFromString(channel); // Increment the session_id everytime we initialize this. If metrics_daemon Loading Loading @@ -143,7 +154,7 @@ bool SystemProfileCache::Populate( metrics::SystemProfileProto* profile_proto = metrics_proto->mutable_system_profile(); profile_proto->mutable_hardware()->set_hardware_class( profile_.hardware_class); profile_.model_manifest_id); profile_proto->set_app_version(profile_.version); profile_proto->set_channel(profile_.channel); metrics::SystemProfileProto_BrilloDeviceData* device_data = Loading metricsd/uploader/system_profile_cache.h +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class ChromeUserMetricsExtension; struct SystemProfile { std::string version; std::string hardware_class; std::string model_manifest_id; std::string client_id; int session_id; metrics::SystemProfileProto::Channel channel; Loading metricsd/uploader/upload_service.h +2 −2 Original line number Diff line number Diff line Loading @@ -46,8 +46,8 @@ class SystemProfileSetter; // // The two states are the presence or not of a staged log. // A staged log is a compressed protobuffer containing both the aggregated // metrics and event and information about the client. (product, hardware id, // etc...). // metrics and event and information about the client. (product, // model_manifest_id, etc...). // // At regular intervals, the upload event will be triggered and the following // will happen: Loading Loading
metricsd/constants.h +4 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,10 @@ static const char kDefaultVersion[] = "0.0.0.0"; // Build time properties name. static const char kProductId[] = "product_id"; static const char kProductVersion[] = "product_version"; // Weave configuration. static const char kWeaveConfigurationFile[] = "/system/etc/weaved/weaved.conf"; static const char kModelManifestId[] = "model_id"; } // namespace metrics #endif // METRICS_CONSTANTS_H_
metricsd/uploader/system_profile_cache.cc +13 −2 Original line number Diff line number Diff line Loading @@ -108,7 +108,18 @@ bool SystemProfileCache::Initialize() { profile_.client_id = testing_ ? "client_id_test" : GetPersistentGUID(guid_path); profile_.hardware_class = "unknown"; profile_.model_manifest_id = "unknown"; if (!testing_) { brillo::KeyValueStore weave_config; if (!weave_config.Load(base::FilePath(metrics::kWeaveConfigurationFile))) { LOG(ERROR) << "Failed to load the weave configuration file."; } else if (!weave_config.GetString(metrics::kModelManifestId, &profile_.model_manifest_id)) { LOG(ERROR) << "The model manifest id (model_id) is undefined in " << metrics::kWeaveConfigurationFile; } } profile_.channel = ProtoChannelFromString(channel); // Increment the session_id everytime we initialize this. If metrics_daemon Loading Loading @@ -143,7 +154,7 @@ bool SystemProfileCache::Populate( metrics::SystemProfileProto* profile_proto = metrics_proto->mutable_system_profile(); profile_proto->mutable_hardware()->set_hardware_class( profile_.hardware_class); profile_.model_manifest_id); profile_proto->set_app_version(profile_.version); profile_proto->set_channel(profile_.channel); metrics::SystemProfileProto_BrilloDeviceData* device_data = Loading
metricsd/uploader/system_profile_cache.h +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class ChromeUserMetricsExtension; struct SystemProfile { std::string version; std::string hardware_class; std::string model_manifest_id; std::string client_id; int session_id; metrics::SystemProfileProto::Channel channel; Loading
metricsd/uploader/upload_service.h +2 −2 Original line number Diff line number Diff line Loading @@ -46,8 +46,8 @@ class SystemProfileSetter; // // The two states are the presence or not of a staged log. // A staged log is a compressed protobuffer containing both the aggregated // metrics and event and information about the client. (product, hardware id, // etc...). // metrics and event and information about the client. (product, // model_manifest_id, etc...). // // At regular intervals, the upload event will be triggered and the following // will happen: Loading