OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/performance_monitor/metric.h" | 5 #include "chrome/browser/performance_monitor/metric.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/time.h" | 10 #include "base/time/time.h" |
11 #include "chrome/browser/performance_monitor/constants.h" | 11 #include "chrome/browser/performance_monitor/constants.h" |
12 | 12 |
13 namespace performance_monitor { | 13 namespace performance_monitor { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 // For certain metrics (for instance, bytes read), it is possible that there is | 17 // For certain metrics (for instance, bytes read), it is possible that there is |
18 // no maximum value which we can safely assume. | 18 // no maximum value which we can safely assume. |
19 const double kNoMaximum = -1.0; | 19 const double kNoMaximum = -1.0; |
20 | 20 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 (value < kMetricBounds[type].max || | 92 (value < kMetricBounds[type].max || |
93 kMetricBounds[type].max == kNoMaximum) && | 93 kMetricBounds[type].max == kNoMaximum) && |
94 value >= kMetricBounds[type].min; | 94 value >= kMetricBounds[type].min; |
95 } | 95 } |
96 | 96 |
97 std::string Metric::ValueAsString() const { | 97 std::string Metric::ValueAsString() const { |
98 return base::DoubleToString(value); | 98 return base::DoubleToString(value); |
99 } | 99 } |
100 | 100 |
101 } // namespace performance_monitor | 101 } // namespace performance_monitor |
OLD | NEW |