Merge "metricsd: Report the model manifest id."
This commit is contained in:
commit
605f2f024b
|
@ -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_
|
||||
|
|
|
@ -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
|
||||
|
@ -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 =
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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…
Reference in New Issue