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 #ifndef NET_DISK_CACHE_BLOCKFILE_STATS_H_ | 5 #ifndef NET_DISK_CACHE_BLOCKFILE_STATS_H_ |
6 #define NET_DISK_CACHE_BLOCKFILE_STATS_H_ | 6 #define NET_DISK_CACHE_BLOCKFILE_STATS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | |
10 | 9 |
11 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/strings/string_split.h" |
12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
13 #include "net/disk_cache/blockfile/addr.h" | 13 #include "net/disk_cache/blockfile/addr.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class HistogramSamples; | 16 class HistogramSamples; |
17 } // namespace base | 17 } // namespace base |
18 | 18 |
19 namespace disk_cache { | 19 namespace disk_cache { |
20 | 20 |
21 typedef std::vector<std::pair<std::string, std::string> > StatsItems; | 21 using StatsItems = base::StringPairs; |
22 | 22 |
23 // This class stores cache-specific usage information, for tunning purposes. | 23 // This class stores cache-specific usage information, for tunning purposes. |
24 class NET_EXPORT_PRIVATE Stats { | 24 class NET_EXPORT_PRIVATE Stats { |
25 public: | 25 public: |
26 static const int kDataSizesLength = 28; | 26 static const int kDataSizesLength = 28; |
27 enum Counters { | 27 enum Counters { |
28 MIN_COUNTER = 0, | 28 MIN_COUNTER = 0, |
29 OPEN_MISS = MIN_COUNTER, | 29 OPEN_MISS = MIN_COUNTER, |
30 OPEN_HIT, | 30 OPEN_HIT, |
31 CREATE_MISS, | 31 CREATE_MISS, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 Addr storage_addr_; | 92 Addr storage_addr_; |
93 int data_sizes_[kDataSizesLength]; | 93 int data_sizes_[kDataSizesLength]; |
94 int64 counters_[MAX_COUNTER]; | 94 int64 counters_[MAX_COUNTER]; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(Stats); | 96 DISALLOW_COPY_AND_ASSIGN(Stats); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace disk_cache | 99 } // namespace disk_cache |
100 | 100 |
101 #endif // NET_DISK_CACHE_BLOCKFILE_STATS_H_ | 101 #endif // NET_DISK_CACHE_BLOCKFILE_STATS_H_ |
OLD | NEW |