Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc

Issue 2546273002: Record DRP histogram on how long back savings were cleared (Closed)
Patch Set: asvitkine comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h" 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 "Net.DailyContentLength_ViaDataReductionProxy_UnknownMime"); 923 "Net.DailyContentLength_ViaDataReductionProxy_UnknownMime");
924 } 924 }
925 925
926 // The system may go backwards in time by up to a day for legitimate 926 // The system may go backwards in time by up to a day for legitimate
927 // reasons, such as with changes to the time zone. In such cases, we 927 // reasons, such as with changes to the time zone. In such cases, we
928 // keep adding to the current day which is why we check for 928 // keep adding to the current day which is why we check for
929 // |days_since_last_update != -1|. 929 // |days_since_last_update != -1|.
930 // Note: we accept the fact that some reported data is shifted to 930 // Note: we accept the fact that some reported data is shifted to
931 // the adjacent day if users travel back and forth across time zones. 931 // the adjacent day if users travel back and forth across time zones.
932 if (days_since_last_update && (days_since_last_update != -1)) { 932 if (days_since_last_update && (days_since_last_update != -1)) {
933 if (days_since_last_update < -1) {
934 pref_service_->SetInt64(
935 prefs::kDataReductionProxySavingsClearedNegativeSystemClock,
936 now.ToInternalValue());
937 UMA_HISTOGRAM_EXACT_LINEAR(
938 "DataReductionProxy.CountSavingsCleared.NegativeSystemClock", 1, 2);
Alexei Svitkine (slow) 2016/12/08 21:24:24 I think logging this in isolation is not very help
tbansal1 2016/12/08 21:47:16 There are other UMA histograms that record that. T
939 }
933 SetInt64(data_reduction_proxy::prefs:: 940 SetInt64(data_reduction_proxy::prefs::
934 kDailyHttpOriginalContentLengthApplication, 941 kDailyHttpOriginalContentLengthApplication,
935 0); 942 0);
936 SetInt64(data_reduction_proxy::prefs:: 943 SetInt64(data_reduction_proxy::prefs::
937 kDailyHttpReceivedContentLengthApplication, 944 kDailyHttpReceivedContentLengthApplication,
938 0); 945 0);
939 946
940 SetInt64( 947 SetInt64(
941 data_reduction_proxy::prefs::kDailyHttpOriginalContentLengthVideo, 0); 948 data_reduction_proxy::prefs::kDailyHttpOriginalContentLengthVideo, 0);
942 SetInt64( 949 SetInt64(
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 std::string DataReductionProxyCompressionStats::NormalizeHostname( 1253 std::string DataReductionProxyCompressionStats::NormalizeHostname(
1247 const std::string& host) { 1254 const std::string& host) {
1248 size_t pos = host.find("://"); 1255 size_t pos = host.find("://");
1249 if (pos != std::string::npos) 1256 if (pos != std::string::npos)
1250 return host.substr(pos + 3); 1257 return host.substr(pos + 3);
1251 1258
1252 return host; 1259 return host;
1253 } 1260 }
1254 1261
1255 } // namespace data_reduction_proxy 1262 } // namespace data_reduction_proxy
OLDNEW
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698