Loading metricsd/aidl/android/brillo/metrics/IMetricsd.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -22,4 +22,5 @@ interface IMetricsd { oneway void recordLinearHistogram(String name, int sample, int max); oneway void recordSparseHistogram(String name, int sample); oneway void recordCrash(String type); String getHistogramsDump(); } metricsd/c_metrics_library.cc +0 −8 Original line number Diff line number Diff line Loading @@ -66,14 +66,6 @@ extern "C" int CMetricsLibrarySendSparseToUMA(CMetricsLibrary handle, return lib->SendSparseToUMA(std::string(name), sample); } extern "C" int CMetricsLibrarySendUserActionToUMA(CMetricsLibrary handle, const char* action) { MetricsLibrary* lib = reinterpret_cast<MetricsLibrary*>(handle); if (lib == NULL) return 0; return lib->SendUserActionToUMA(std::string(action)); } extern "C" int CMetricsLibrarySendCrashToUMA(CMetricsLibrary handle, const char* crash_kind) { MetricsLibrary* lib = reinterpret_cast<MetricsLibrary*>(handle); Loading metricsd/include/metrics/c_metrics_library.h +0 −4 Original line number Diff line number Diff line Loading @@ -44,10 +44,6 @@ int CMetricsLibrarySendEnumToUMA(CMetricsLibrary handle, int CMetricsLibrarySendSparseToUMA(CMetricsLibrary handle, const char* name, int sample); // C wrapper for MetricsLibrary::SendUserActionToUMA. int CMetricsLibrarySendUserActionToUMA(CMetricsLibrary handle, const char* action); // C wrapper for MetricsLibrary::SendCrashToUMA. int CMetricsLibrarySendCrashToUMA(CMetricsLibrary handle, const char* crash_kind); Loading metricsd/include/metrics/metrics_library.h +5 −13 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ class MetricsLibraryInterface { virtual bool SendEnumToUMA(const std::string& name, int sample, int max) = 0; virtual bool SendBoolToUMA(const std::string& name, bool sample) = 0; virtual bool SendSparseToUMA(const std::string& name, int sample) = 0; virtual bool SendUserActionToUMA(const std::string& action) = 0; virtual ~MetricsLibraryInterface() {} }; Loading Loading @@ -114,18 +113,6 @@ class MetricsLibrary : public MetricsLibraryInterface { // |sample| is the 32-bit integer value to be recorded. bool SendSparseToUMA(const std::string& name, int sample) override; // Sends a user action to Chrome for transport to UMA and returns true on // success. This method results in the equivalent of an asynchronous // non-blocking RPC to UserMetrics::RecordAction. The new metric must be // added to chrome/tools/extract_actions.py in the Chromium repository, which // should then be run to generate a hash for the new action. // // Until http://crosbug.com/11125 is fixed, the metric must also be added to // chrome/browser/chromeos/external_metrics.cc. // // |action| is the user-generated event (e.g., "MuteKeyPressed"). bool SendUserActionToUMA(const std::string& action) override; // Sends a signal to UMA that a crash of the given |crash_kind| // has occurred. Used by UMA to generate stability statistics. bool SendCrashToUMA(const char *crash_kind); Loading @@ -138,6 +125,11 @@ class MetricsLibrary : public MetricsLibraryInterface { // number in the histograms dashboard). bool SendCrosEventToUMA(const std::string& event); // Debugging only. // Dumps the histograms aggregated since metricsd started into |dump|. // Returns true iff the dump succeeds. bool GetHistogramsDump(std::string* dump); private: friend class CMetricsLibraryTest; friend class MetricsLibraryTest; Loading metricsd/include/metrics/metrics_library_mock.h +0 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ class MetricsLibraryMock : public MetricsLibraryInterface { int max)); MOCK_METHOD2(SendBoolToUMA, bool(const std::string& name, bool sample)); MOCK_METHOD2(SendSparseToUMA, bool(const std::string& name, int sample)); MOCK_METHOD1(SendUserActionToUMA, bool(const std::string& action)); bool AreMetricsEnabled() override {return metrics_enabled_;}; }; Loading Loading
metricsd/aidl/android/brillo/metrics/IMetricsd.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -22,4 +22,5 @@ interface IMetricsd { oneway void recordLinearHistogram(String name, int sample, int max); oneway void recordSparseHistogram(String name, int sample); oneway void recordCrash(String type); String getHistogramsDump(); }
metricsd/c_metrics_library.cc +0 −8 Original line number Diff line number Diff line Loading @@ -66,14 +66,6 @@ extern "C" int CMetricsLibrarySendSparseToUMA(CMetricsLibrary handle, return lib->SendSparseToUMA(std::string(name), sample); } extern "C" int CMetricsLibrarySendUserActionToUMA(CMetricsLibrary handle, const char* action) { MetricsLibrary* lib = reinterpret_cast<MetricsLibrary*>(handle); if (lib == NULL) return 0; return lib->SendUserActionToUMA(std::string(action)); } extern "C" int CMetricsLibrarySendCrashToUMA(CMetricsLibrary handle, const char* crash_kind) { MetricsLibrary* lib = reinterpret_cast<MetricsLibrary*>(handle); Loading
metricsd/include/metrics/c_metrics_library.h +0 −4 Original line number Diff line number Diff line Loading @@ -44,10 +44,6 @@ int CMetricsLibrarySendEnumToUMA(CMetricsLibrary handle, int CMetricsLibrarySendSparseToUMA(CMetricsLibrary handle, const char* name, int sample); // C wrapper for MetricsLibrary::SendUserActionToUMA. int CMetricsLibrarySendUserActionToUMA(CMetricsLibrary handle, const char* action); // C wrapper for MetricsLibrary::SendCrashToUMA. int CMetricsLibrarySendCrashToUMA(CMetricsLibrary handle, const char* crash_kind); Loading
metricsd/include/metrics/metrics_library.h +5 −13 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ class MetricsLibraryInterface { virtual bool SendEnumToUMA(const std::string& name, int sample, int max) = 0; virtual bool SendBoolToUMA(const std::string& name, bool sample) = 0; virtual bool SendSparseToUMA(const std::string& name, int sample) = 0; virtual bool SendUserActionToUMA(const std::string& action) = 0; virtual ~MetricsLibraryInterface() {} }; Loading Loading @@ -114,18 +113,6 @@ class MetricsLibrary : public MetricsLibraryInterface { // |sample| is the 32-bit integer value to be recorded. bool SendSparseToUMA(const std::string& name, int sample) override; // Sends a user action to Chrome for transport to UMA and returns true on // success. This method results in the equivalent of an asynchronous // non-blocking RPC to UserMetrics::RecordAction. The new metric must be // added to chrome/tools/extract_actions.py in the Chromium repository, which // should then be run to generate a hash for the new action. // // Until http://crosbug.com/11125 is fixed, the metric must also be added to // chrome/browser/chromeos/external_metrics.cc. // // |action| is the user-generated event (e.g., "MuteKeyPressed"). bool SendUserActionToUMA(const std::string& action) override; // Sends a signal to UMA that a crash of the given |crash_kind| // has occurred. Used by UMA to generate stability statistics. bool SendCrashToUMA(const char *crash_kind); Loading @@ -138,6 +125,11 @@ class MetricsLibrary : public MetricsLibraryInterface { // number in the histograms dashboard). bool SendCrosEventToUMA(const std::string& event); // Debugging only. // Dumps the histograms aggregated since metricsd started into |dump|. // Returns true iff the dump succeeds. bool GetHistogramsDump(std::string* dump); private: friend class CMetricsLibraryTest; friend class MetricsLibraryTest; Loading
metricsd/include/metrics/metrics_library_mock.h +0 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ class MetricsLibraryMock : public MetricsLibraryInterface { int max)); MOCK_METHOD2(SendBoolToUMA, bool(const std::string& name, bool sample)); MOCK_METHOD2(SendSparseToUMA, bool(const std::string& name, int sample)); MOCK_METHOD1(SendUserActionToUMA, bool(const std::string& action)); bool AreMetricsEnabled() override {return metrics_enabled_;}; }; Loading