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

Side by Side Diff: chrome/browser/android/data_usage/external_data_use_observer.cc

Issue 1582043002: Add histograms for data usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed holte comments Created 4 years, 11 months 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/android/data_usage/external_data_use_observer.h" 5 #include "chrome/browser/android/data_usage/external_data_use_observer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 DCHECK(thread_checker_.CalledOnValidThread()); 198 DCHECK(thread_checker_.CalledOnValidThread());
199 DCHECK(!last_data_report_submitted_ticks_.is_null()); 199 DCHECK(!last_data_report_submitted_ticks_.is_null());
200 200
201 if (success) { 201 if (success) {
202 RecordDataUsageReportSubmission(DATAUSAGE_REPORT_SUBMISSION_SUCCESSFUL, 202 RecordDataUsageReportSubmission(DATAUSAGE_REPORT_SUBMISSION_SUCCESSFUL,
203 pending_report_bytes_); 203 pending_report_bytes_);
204 } else { 204 } else {
205 RecordDataUsageReportSubmission(DATAUSAGE_REPORT_SUBMISSION_FAILED, 205 RecordDataUsageReportSubmission(DATAUSAGE_REPORT_SUBMISSION_FAILED,
206 pending_report_bytes_); 206 pending_report_bytes_);
207 } 207 }
208 UMA_HISTOGRAM_TIMES(
209 "DataUsage.Perf.ReportSubmissionDuration",
210 base::TimeTicks::Now() - last_data_report_submitted_ticks_);
208 211
209 last_data_report_submitted_ticks_ = base::TimeTicks(); 212 last_data_report_submitted_ticks_ = base::TimeTicks();
210 pending_report_bytes_ = 0; 213 pending_report_bytes_ = 0;
211 214
212 SubmitBufferedDataUseReport(false); 215 SubmitBufferedDataUseReport(false);
213 } 216 }
214 217
215 #if defined(OS_ANDROID) 218 #if defined(OS_ANDROID)
216 void ExternalDataUseObserver::OnApplicationStateChange( 219 void ExternalDataUseObserver::OnApplicationStateChange(
217 base::android::ApplicationState new_state) { 220 base::android::ApplicationState new_state) {
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 size_t hash = 1; 441 size_t hash = 1;
439 hash = hash * 23 + hash_function(k.label); 442 hash = hash * 23 + hash_function(k.label);
440 hash = hash * 43 + k.connection_type; 443 hash = hash * 43 + k.connection_type;
441 hash = hash * 83 + hash_function(k.mcc_mnc); 444 hash = hash * 83 + hash_function(k.mcc_mnc);
442 return hash; 445 return hash;
443 } 446 }
444 447
445 } // namespace android 448 } // namespace android
446 449
447 } // namespace chrome 450 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698