| 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/backend_impl.h" | 5 #include "net/disk_cache/backend_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 CACHE_UMA(COUNTS_10000, "TotalFatalErrors", 0, | 1889 CACHE_UMA(COUNTS_10000, "TotalFatalErrors", 0, |
| 1890 static_cast<int>(stats_.GetCounter(Stats::FATAL_ERROR))); | 1890 static_cast<int>(stats_.GetCounter(Stats::FATAL_ERROR))); |
| 1891 CACHE_UMA(COUNTS_10000, "TotalDoomCache", 0, | 1891 CACHE_UMA(COUNTS_10000, "TotalDoomCache", 0, |
| 1892 static_cast<int>(stats_.GetCounter(Stats::DOOM_CACHE))); | 1892 static_cast<int>(stats_.GetCounter(Stats::DOOM_CACHE))); |
| 1893 CACHE_UMA(COUNTS_10000, "TotalDoomRecentEntries", 0, | 1893 CACHE_UMA(COUNTS_10000, "TotalDoomRecentEntries", 0, |
| 1894 static_cast<int>(stats_.GetCounter(Stats::DOOM_RECENT))); | 1894 static_cast<int>(stats_.GetCounter(Stats::DOOM_RECENT))); |
| 1895 stats_.SetCounter(Stats::FATAL_ERROR, 0); | 1895 stats_.SetCounter(Stats::FATAL_ERROR, 0); |
| 1896 stats_.SetCounter(Stats::DOOM_CACHE, 0); | 1896 stats_.SetCounter(Stats::DOOM_CACHE, 0); |
| 1897 stats_.SetCounter(Stats::DOOM_RECENT, 0); | 1897 stats_.SetCounter(Stats::DOOM_RECENT, 0); |
| 1898 | 1898 |
| 1899 CACHE_UMA(AGE, "FilesAge", 0, | 1899 int age = (Time::Now() - |
| 1900 Time::FromInternalValue(data_->header.create_time)); | 1900 Time::FromInternalValue(data_->header.create_time)).InHours(); |
| 1901 if (age) |
| 1902 CACHE_UMA(HOURS, "FilesAge", 0, age); |
| 1901 | 1903 |
| 1902 int64 total_hours = stats_.GetCounter(Stats::TIMER) / 120; | 1904 int64 total_hours = stats_.GetCounter(Stats::TIMER) / 120; |
| 1903 if (!data_->header.create_time || !data_->header.lru.filled) { | 1905 if (!data_->header.create_time || !data_->header.lru.filled) { |
| 1904 int cause = data_->header.create_time ? 0 : 1; | 1906 int cause = data_->header.create_time ? 0 : 1; |
| 1905 if (!data_->header.lru.filled) | 1907 if (!data_->header.lru.filled) |
| 1906 cause |= 2; | 1908 cause |= 2; |
| 1907 CACHE_UMA(CACHE_ERROR, "ShortReport", 0, cause); | 1909 CACHE_UMA(CACHE_ERROR, "ShortReport", 0, cause); |
| 1908 CACHE_UMA(HOURS, "TotalTimeNotFull", 0, static_cast<int>(total_hours)); | 1910 CACHE_UMA(HOURS, "TotalTimeNotFull", 0, static_cast<int>(total_hours)); |
| 1909 return; | 1911 return; |
| 1910 } | 1912 } |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2112 if (total_memory > kMaxBuffersSize || total_memory <= 0) | 2114 if (total_memory > kMaxBuffersSize || total_memory <= 0) |
| 2113 total_memory = kMaxBuffersSize; | 2115 total_memory = kMaxBuffersSize; |
| 2114 | 2116 |
| 2115 done = true; | 2117 done = true; |
| 2116 } | 2118 } |
| 2117 | 2119 |
| 2118 return static_cast<int>(total_memory); | 2120 return static_cast<int>(total_memory); |
| 2119 } | 2121 } |
| 2120 | 2122 |
| 2121 } // namespace disk_cache | 2123 } // namespace disk_cache |
| OLD | NEW |