OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/disk_cache/stats.h" | 5 #include "net/disk_cache/blockfile/stats.h" |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram_samples.h" | 9 #include "base/metrics/histogram_samples.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 const int32 kDiskSignature = 0xF01427E0; | 15 const int32 kDiskSignature = 0xF01427E0; |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 int Stats::GetRatio(Counters hit, Counters miss) const { | 303 int Stats::GetRatio(Counters hit, Counters miss) const { |
304 int64 ratio = GetCounter(hit) * 100; | 304 int64 ratio = GetCounter(hit) * 100; |
305 if (!ratio) | 305 if (!ratio) |
306 return 0; | 306 return 0; |
307 | 307 |
308 ratio /= (GetCounter(hit) + GetCounter(miss)); | 308 ratio /= (GetCounter(hit) + GetCounter(miss)); |
309 return static_cast<int>(ratio); | 309 return static_cast<int>(ratio); |
310 } | 310 } |
311 | 311 |
312 } // namespace disk_cache | 312 } // namespace disk_cache |
OLD | NEW |