diff options
author | mmortensen@google.com <mmortensen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 16:48:05 +0000 |
---|---|---|
committer | mmortensen@google.com <mmortensen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 16:48:05 +0000 |
commit | 9ec7446c2fc481ca998ebda86466f996d6fc4f8d (patch) | |
tree | b0fb98b5aa510f37f666b8eb021b4c726aaad1b3 /base/metrics | |
parent | 6d74fd27cb304212abe145855b540051d2192aa9 (diff) | |
download | chromium_src-9ec7446c2fc481ca998ebda86466f996d6fc4f8d.zip chromium_src-9ec7446c2fc481ca998ebda86466f996d6fc4f8d.tar.gz chromium_src-9ec7446c2fc481ca998ebda86466f996d6fc4f8d.tar.bz2 |
Add histogram to track number of .nexe launches, normalized against opening new tabs.
BUG=914 (http://code.google.com/p/nativeclient/issues/detail?id=914)
TEST=none
Relied on trybots and manually checking "about:histograms"
Review URL: http://codereview.chromium.org/4065005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64261 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/metrics')
-rw-r--r-- | base/metrics/nacl_histogram.cc | 23 | ||||
-rw-r--r-- | base/metrics/nacl_histogram.h | 29 |
2 files changed, 52 insertions, 0 deletions
diff --git a/base/metrics/nacl_histogram.cc b/base/metrics/nacl_histogram.cc new file mode 100644 index 0000000..c89e646 --- /dev/null +++ b/base/metrics/nacl_histogram.cc @@ -0,0 +1,23 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// nacl_histogram provides an enum and defines a macro that uses definitions +// from histogram.h. Note that a histogram is an object that aggregates +// statistics, and can summarize them in various forms, including ASCII +// graphical, HTML, and numerically. +// nacl_histogram information is used to compare how many times a native +// client module has been loaded, compared to the number of chrome starts +// and number of new tabs created. + + +#include "base/metrics/histogram.h" +#include "base/metrics/nacl_histogram.h" + +// To log histogram data about NaCl.Startups, call this function with +// a NaClHistogramValue passed in as |hvalue| +void UmaNaclHistogramEnumeration(NaClHistogramValue histogram_value) { + UMA_HISTOGRAM_ENUMERATION("NaCl.Startups", histogram_value, + NACL_MAX_HISTOGRAM); +} + diff --git a/base/metrics/nacl_histogram.h b/base/metrics/nacl_histogram.h new file mode 100644 index 0000000..479b571 --- /dev/null +++ b/base/metrics/nacl_histogram.h @@ -0,0 +1,29 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// nacl_histogram provides an enum and defines a macro that uses definitions +// from histogram.h. Note that a histogram is an object that aggregates +// statistics, and can summarize them in various forms, including ASCII +// graphical, HTML, and numerically. +// nacl_histogram information is used to compare how many times a native +// client module has been loaded, compared to the number of chrome starts +// and number of new tabs created. + +#ifndef BASE_METRICS_NACL_HISTOGRAM_H_ +#define BASE_METRICS_NACL_HISTOGRAM_H_ +#pragma once + +enum NaClHistogramValue { + FIRST_TAB_NACL_BASELINE, // First tab created - a baseline for NaCl starts. + NEW_TAB_NACL_BASELINE, // New tab created -- a baseline for NaCl starts. + NACL_STARTED, // NaCl process started + NACL_MAX_HISTOGRAM // DO NOT USE -- used by histogram for max bound. +}; + +// To log histogram data about NaCl.Startups, call this macro with +// a NaClHistogramValue passed in as |histogram_value| +void UmaNaclHistogramEnumeration(NaClHistogramValue histogram_value); + +#endif // BASE_METRICS_NACL_HISTOGRAM_H_ + |