Remove the deprecated static metrics APIs.

Review URL: http://codereview.chromium.org/2037011
This commit is contained in:
Darin Petkov 2010-05-12 15:26:16 -07:00
parent fc91b42a5e
commit 21cd2c5a9f
4 changed files with 11 additions and 47 deletions

View File

@ -42,14 +42,9 @@ a module, you need to do the following:
int max)
sends a sample for an enumeration (linear) histogram.
Currently, the API also includes two deprecated static methods:
bool MetricsLibrary::SendToChrome(const std::string& name, int sample,
int min, int max, int nbuckets)
bool MetricsLibrary::SendEnumToChrome(const std::string& name, int sample,
int max)
See the API documentation in metrics_library.h under
Before using these methods, a MetricsLibrary object needs to be
constructed and initialized through its Init method. See the
complete API documentation in metrics_library.h under
src/platform/metrics/.
- On the target platform, shortly after the sample is sent it should

View File

@ -78,14 +78,16 @@ int main(int argc, char** argv) {
}
if (send_to_chrome) {
MetricsLibrary metrics_lib;
metrics_lib.Init();
if (send_enum) {
int max = atoi(argv[name_index + 2]);
MetricsLibrary::SendEnumToChrome(name, sample, max);
metrics_lib.SendEnumToUMA(name, sample, max);
} else {
int min = atoi(argv[name_index + 2]);
int max = atoi(argv[name_index + 3]);
int nbuckets = atoi(argv[name_index + 4]);
MetricsLibrary::SendToChrome(name, sample, min, max, nbuckets);
metrics_lib.SendToUMA(name, sample, min, max, nbuckets);
}
}
return 0;

View File

@ -2,13 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/*
* metrics_library.cc
*
* Created on: Dec 1, 2009
* Author: sosa
*/
#include "metrics_library.h"
#include <errno.h>
@ -137,9 +130,8 @@ bool MetricsLibrary::SendToAutotest(const string& name, int value) {
return true;
}
// static
bool MetricsLibrary::SendToChrome(const string& name, int sample,
int min, int max, int nbuckets) {
bool MetricsLibrary::SendToUMA(const string& name, int sample,
int min, int max, int nbuckets) {
// Format the message.
char message[kBufferSize];
int32_t message_length =
@ -154,14 +146,8 @@ bool MetricsLibrary::SendToChrome(const string& name, int sample,
return SendMessageToChrome(message_length, message);
}
bool MetricsLibrary::SendToUMA(const string& name, int sample,
int min, int max, int nbuckets) {
return SendToChrome(name, sample, min, max, nbuckets);
}
//static
bool MetricsLibrary::SendEnumToChrome(const std::string& name, int sample,
int max) {
bool MetricsLibrary::SendEnumToUMA(const std::string& name, int sample,
int max) {
// Format the message.
char message[kBufferSize];
int32_t message_length =
@ -175,8 +161,3 @@ bool MetricsLibrary::SendEnumToChrome(const std::string& name, int sample,
// Send the message.
return SendMessageToChrome(message_length, message);
}
bool MetricsLibrary::SendEnumToUMA(const std::string& name, int sample,
int max) {
return SendEnumToChrome(name, sample, max);
}

View File

@ -2,13 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/*
* metrics_library.h
*
* Created on: Dec 1, 2009
* Author: sosa
*/
#ifndef METRICS_LIBRARY_H_
#define METRICS_LIBRARY_H_
@ -45,10 +38,6 @@ class MetricsLibrary : public MetricsLibraryInterface {
bool SendToUMA(const std::string& name, int sample,
int min, int max, int nbuckets);
// Deprecated.
static bool SendToChrome(const std::string& name, int sample,
int min, int max, int nbuckets);
// Sends linear histogram data to Chrome for transport to UMA and
// returns true on success. This method results in the equivalent of
// an asynchronous non-blocking RPC to UMA_HISTOGRAM_ENUMERATION
@ -60,9 +49,6 @@ class MetricsLibrary : public MetricsLibraryInterface {
// [|max|,infinity) is the implicit overflow bucket.
bool SendEnumToUMA(const std::string& name, int sample, int max);
// Deprecated.
static bool SendEnumToChrome(const std::string& name, int sample, int max);
// Sends to Autotest and returns true on success.
static bool SendToAutotest(const std::string& name, int value);
};