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 "net/disk_cache/blockfile/block_bitmaps_v3.h" | 5 #include "net/disk_cache/blockfile/block_bitmaps_v3.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "net/disk_cache/blockfile/disk_format_base.h" | 9 #include "net/disk_cache/blockfile/disk_format_base.h" |
10 #include "net/disk_cache/blockfile/trace.h" | 10 #include "net/disk_cache/blockfile/trace.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 address.num_blocks()); | 64 address.num_blocks()); |
65 } | 65 } |
66 | 66 |
67 void BlockBitmaps::Clear() { | 67 void BlockBitmaps::Clear() { |
68 bitmaps_.clear(); | 68 bitmaps_.clear(); |
69 } | 69 } |
70 | 70 |
71 void BlockBitmaps::ReportStats() { | 71 void BlockBitmaps::ReportStats() { |
72 int used_blocks[kFirstAdditionalBlockFile]; | 72 int used_blocks[kFirstAdditionalBlockFile]; |
73 int load[kFirstAdditionalBlockFile]; | 73 int load[kFirstAdditionalBlockFile]; |
74 for (int16 i = 0; i < kFirstAdditionalBlockFile; i++) { | 74 for (int16_t i = 0; i < kFirstAdditionalBlockFile; i++) { |
75 GetFileStats(i, &used_blocks[i], &load[i]); | 75 GetFileStats(i, &used_blocks[i], &load[i]); |
76 } | 76 } |
77 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_0", used_blocks[0]); | 77 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_0", used_blocks[0]); |
78 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_1", used_blocks[1]); | 78 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_1", used_blocks[1]); |
79 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_2", used_blocks[2]); | 79 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_2", used_blocks[2]); |
80 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_3", used_blocks[3]); | 80 UMA_HISTOGRAM_COUNTS("DiskCache.Blocks_3", used_blocks[3]); |
81 | 81 |
82 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_0", load[0], 101); | 82 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_0", load[0], 101); |
83 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_1", load[1], 101); | 83 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_1", load[1], 101); |
84 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_2", load[2], 101); | 84 UMA_HISTOGRAM_ENUMERATION("DiskCache.BlockLoad_2", load[2], 101); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 *used_count += used; | 170 *used_count += used; |
171 | 171 |
172 index = bitmaps_[index].NextFileId(); | 172 index = bitmaps_[index].NextFileId(); |
173 } while (index); | 173 } while (index); |
174 | 174 |
175 if (max_blocks) | 175 if (max_blocks) |
176 *load = *used_count * 100 / max_blocks; | 176 *load = *used_count * 100 / max_blocks; |
177 } | 177 } |
178 | 178 |
179 } // namespace disk_cache | 179 } // namespace disk_cache |
OLD | NEW |