Avi Drissman | 8ba1bad | 2022-09-13 19:22:36 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors |
[email protected] | 62ca95c | 2014-04-24 16:48:30 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // This file contains a set of histogram support functions for logging behavior |
| 6 | // seen while loading NaCl plugins. |
| 7 | |
jvoung | 0ecfdd57 | 2015-04-02 16:49:31 | [diff] [blame] | 8 | #ifndef COMPONENTS_NACL_RENDERER_HISTOGRAM_H_ |
| 9 | #define COMPONENTS_NACL_RENDERER_HISTOGRAM_H_ |
| 10 | |
avi | 2606292 | 2015-12-26 00:14:18 | [diff] [blame] | 11 | #include <stdint.h> |
| 12 | |
[email protected] | 62ca95c | 2014-04-24 16:48:30 | [diff] [blame] | 13 | #include <string> |
| 14 | #include "base/time/time.h" |
mseaborn | 3cf62d9 | 2015-02-10 21:20:01 | [diff] [blame] | 15 | #include "components/nacl/renderer/ppb_nacl_private.h" |
[email protected] | 62ca95c | 2014-04-24 16:48:30 | [diff] [blame] | 16 | |
| 17 | namespace nacl { |
| 18 | |
| 19 | void HistogramCustomCounts(const std::string& name, |
| 20 | int32_t sample, |
| 21 | int32_t min, |
| 22 | int32_t max, |
| 23 | uint32_t bucket_count); |
| 24 | |
| 25 | void HistogramEnumerate(const std::string& name, |
| 26 | int32_t sample, |
| 27 | int32_t boundary_value); |
| 28 | |
| 29 | void HistogramEnumerateLoadStatus(PP_NaClError error_code, |
| 30 | bool is_installed); |
| 31 | |
| 32 | void HistogramEnumerateOsArch(const std::string& sandbox_isa); |
| 33 | |
| 34 | // Records values up to 20 seconds. |
| 35 | void HistogramTimeSmall(const std::string& name, int64_t sample); |
| 36 | // Records values up to 3 minutes, 20 seconds. |
| 37 | void HistogramTimeMedium(const std::string& name, int64_t sample); |
| 38 | // Records values up to 33 minutes. |
| 39 | void HistogramTimeLarge(const std::string& name, int64_t sample); |
[email protected] | 468953b | 2014-06-13 19:40:43 | [diff] [blame] | 40 | // Records values up to 12 minutes. |
| 41 | void HistogramTimeTranslation(const std::string& name, int64_t sample_ms); |
[email protected] | 62ca95c | 2014-04-24 16:48:30 | [diff] [blame] | 42 | |
| 43 | void HistogramStartupTimeSmall(const std::string& name, |
| 44 | base::TimeDelta td, |
| 45 | int64_t nexe_size); |
| 46 | void HistogramStartupTimeMedium(const std::string& name, |
| 47 | base::TimeDelta td, |
| 48 | int64_t nexe_size); |
| 49 | void HistogramSizeKB(const std::string& name, int32_t sample); |
| 50 | void HistogramHTTPStatusCode(const std::string& name, int32_t status); |
| 51 | void HistogramEnumerateManifestIsDataURI(bool is_data_uri); |
[email protected] | 468953b | 2014-06-13 19:40:43 | [diff] [blame] | 52 | void HistogramKBPerSec(const std::string& name, int64_t kb, int64_t us); |
jvoung | 0ecfdd57 | 2015-04-02 16:49:31 | [diff] [blame] | 53 | void HistogramRatio(const std::string& name, |
| 54 | int64_t numerator, |
| 55 | int64_t denominator); |
[email protected] | 62ca95c | 2014-04-24 16:48:30 | [diff] [blame] | 56 | |
| 57 | } // namespace nacl |
jvoung | 0ecfdd57 | 2015-04-02 16:49:31 | [diff] [blame] | 58 | |
| 59 | #endif // COMPONENTS_NACL_RENDERER_HISTOGRAM_H_ |