1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 8 #include <string> 9 #include "base/time/time.h" 10 #include "ppapi/c/private/ppb_nacl_private.h" 11 12 namespace nacl { 13 14 void HistogramCustomCounts(const std::string& name, 15 int32_t sample, 16 int32_t min, 17 int32_t max, 18 uint32_t bucket_count); 19 20 void HistogramEnumerate(const std::string& name, 21 int32_t sample, 22 int32_t boundary_value); 23 24 void HistogramEnumerateLoadStatus(PP_NaClError error_code, 25 bool is_installed); 26 27 void HistogramEnumerateOsArch(const std::string& sandbox_isa); 28 29 // Records values up to 20 seconds. 30 void HistogramTimeSmall(const std::string& name, int64_t sample); 31 // Records values up to 3 minutes, 20 seconds. 32 void HistogramTimeMedium(const std::string& name, int64_t sample); 33 // Records values up to 33 minutes. 34 void HistogramTimeLarge(const std::string& name, int64_t sample); 35 // Records values up to 12 minutes. 36 void HistogramTimeTranslation(const std::string& name, int64_t sample_ms); 37 38 void HistogramStartupTimeSmall(const std::string& name, 39 base::TimeDelta td, 40 int64_t nexe_size); 41 void HistogramStartupTimeMedium(const std::string& name, 42 base::TimeDelta td, 43 int64_t nexe_size); 44 void HistogramSizeKB(const std::string& name, int32_t sample); 45 void HistogramHTTPStatusCode(const std::string& name, int32_t status); 46 void HistogramEnumerateManifestIsDataURI(bool is_data_uri); 47 void HistogramKBPerSec(const std::string& name, int64_t kb, int64_t us); 48 49 } // namespace nacl 50