diff --git a/metricsd/etc/weaved/traits/metrics.json b/metricsd/etc/weaved/traits/metrics.json index 7d17c7774..7583270e5 100644 --- a/metricsd/etc/weaved/traits/metrics.json +++ b/metricsd/etc/weaved/traits/metrics.json @@ -1,15 +1,17 @@ { "_metrics": { "commands": { - "_enableAnalyticsReporting": { - "minimalRole": "manager" + "enableAnalyticsReporting": { + "minimalRole": "manager", + "parameters": {} }, - "_disableAnalyticsReporting": { - "minimalRole": "manager" + "disableAnalyticsReporting": { + "minimalRole": "manager", + "parameters": {} } }, "state": { - "_AnalyticsReportingState": { + "analyticsReportingState": { "type": "string", "enum": [ "enabled", "disabled" ] } diff --git a/metricsd/metrics_collector.cc b/metricsd/metrics_collector.cc index b5c22892d..e9edf2ed3 100644 --- a/metricsd/metrics_collector.cc +++ b/metricsd/metrics_collector.cc @@ -229,11 +229,11 @@ int MetricsCollector::OnInit() { device_->AddComponent(kWeaveComponent, {"_metrics"}); device_->AddCommandHandler( kWeaveComponent, - "_metrics._enableAnalyticsReporting", + "_metrics.enableAnalyticsReporting", base::Bind(&MetricsCollector::OnEnableMetrics, base::Unretained(this))); device_->AddCommandHandler( kWeaveComponent, - "_metrics._disableAnalyticsReporting", + "_metrics.disableAnalyticsReporting", base::Bind(&MetricsCollector::OnDisableMetrics, base::Unretained(this))); latest_cpu_use_microseconds_ = cpu_usage_collector_->GetCumulativeCpuUse(); @@ -294,7 +294,7 @@ void MetricsCollector::UpdateWeaveState() { metrics_lib_->AreMetricsEnabled() ? "enabled" : "disabled"; if (!device_->SetStateProperty(kWeaveComponent, - "_metrics._AnalyticsReportingState", + "_metrics.analyticsReportingState", enabled, nullptr)) { LOG(ERROR) << "failed to update weave's state";