| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This file contains macros to simplify histogram reporting from the disk | 5 // This file contains macros to simplify histogram reporting from the disk |
| 6 // cache. The main issue is that we want to have separate histograms for each | 6 // cache. The main issue is that we want to have separate histograms for each |
| 7 // type of cache (regular vs. media, etc), without adding the complexity of | 7 // type of cache (regular vs. media, etc), without adding the complexity of |
| 8 // keeping track of a potentially large number of histogram objects that have to | 8 // keeping track of a potentially large number of histogram objects that have to |
| 9 // survive the backend object that created them. | 9 // survive the backend object that created them. |
| 10 | 10 |
| 11 #ifndef NET_DISK_CACHE_HISTOGRAM_MACROS_H_ | 11 #ifndef NET_DISK_CACHE_HISTOGRAM_MACROS_H_ |
| 12 #define NET_DISK_CACHE_HISTOGRAM_MACROS_H_ | 12 #define NET_DISK_CACHE_HISTOGRAM_MACROS_H_ |
| 13 | 13 |
| 14 // HISTOGRAM_HOURS will collect time related data with a granularity of hours | 14 // HISTOGRAM_HOURS will collect time related data with a granularity of hours |
| 15 // and normal values of a few months. | 15 // and normal values of a few months. |
| 16 #define UMA_HISTOGRAM_HOURS UMA_HISTOGRAM_COUNTS_10000 | 16 #define UMA_HISTOGRAM_HOURS UMA_HISTOGRAM_COUNTS_10000 |
| 17 | 17 |
| 18 // HISTOGRAM_AGE will collect time elapsed since |initial_time|, with a | 18 // HISTOGRAM_AGE will collect time elapsed since |initial_time|, with a |
| 19 // granularity of hours and normal values of a few months. | 19 // granularity of hours and normal values of a few months. |
| 20 #define UMA_HISTOGRAM_AGE(name, initial_time)\ | 20 #define UMA_HISTOGRAM_AGE(name, initial_time) \ |
| 21 UMA_HISTOGRAM_COUNTS_10000(name, (Time::Now() - initial_time).InHours()) | 21 UMA_HISTOGRAM_COUNTS_10000(name, (Time::Now() - initial_time).InHours()) |
| 22 | 22 |
| 23 // HISTOGRAM_AGE_MS will collect time elapsed since |initial_time|, with the | 23 // HISTOGRAM_AGE_MS will collect time elapsed since |initial_time|, with the |
| 24 // normal resolution of the UMA_HISTOGRAM_TIMES. | 24 // normal resolution of the UMA_HISTOGRAM_TIMES. |
| 25 #define UMA_HISTOGRAM_AGE_MS(name, initial_time)\ | 25 #define UMA_HISTOGRAM_AGE_MS(name, initial_time)\ |
| 26 UMA_HISTOGRAM_TIMES(name, Time::Now() - initial_time) | 26 UMA_HISTOGRAM_TIMES(name, TimeTicks::Now() - initial_time) |
| 27 | 27 |
| 28 #define UMA_HISTOGRAM_CACHE_ERROR(name, sample) \ | 28 #define UMA_HISTOGRAM_CACHE_ERROR(name, sample) \ |
| 29 UMA_HISTOGRAM_ENUMERATION(name, sample, 50) | 29 UMA_HISTOGRAM_ENUMERATION(name, sample, 50) |
| 30 | 30 |
| 31 #ifdef NET_DISK_CACHE_BACKEND_IMPL_CC_ | 31 #ifdef NET_DISK_CACHE_BACKEND_IMPL_CC_ |
| 32 #define BACKEND_OBJ this | 32 #define BACKEND_OBJ this |
| 33 #else | 33 #else |
| 34 #define BACKEND_OBJ backend_ | 34 #define BACKEND_OBJ backend_ |
| 35 #endif | 35 #endif |
| 36 | 36 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 53 case net::MEDIA_CACHE:\ | 53 case net::MEDIA_CACHE:\ |
| 54 UMA_HISTOGRAM_##type(my_name.data(), sample);\ | 54 UMA_HISTOGRAM_##type(my_name.data(), sample);\ |
| 55 break;\ | 55 break;\ |
| 56 default:\ | 56 default:\ |
| 57 NOTREACHED();\ | 57 NOTREACHED();\ |
| 58 break;\ | 58 break;\ |
| 59 }\ | 59 }\ |
| 60 } | 60 } |
| 61 | 61 |
| 62 #endif // NET_DISK_CACHE_HISTOGRAM_MACROS_H_ | 62 #endif // NET_DISK_CACHE_HISTOGRAM_MACROS_H_ |
| OLD | NEW |