OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/common/metrics_helpers.h" | 5 #include "chrome/common/metrics_helpers.h" |
6 | 6 |
7 #if defined(USE_SYSTEM_LIBBZ2) | 7 #if defined(USE_SYSTEM_LIBBZ2) |
8 #include <bzlib.h> | 8 #include <bzlib.h> |
9 #else | 9 #else |
10 #include "third_party/bzip2/bzlib.h" | 10 #include "third_party/bzip2/bzlib.h" |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 void MetricsServiceBase::UniqueInconsistencyDetected(int problem) { | 492 void MetricsServiceBase::UniqueInconsistencyDetected(int problem) { |
493 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique", | 493 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique", |
494 problem, Histogram::NEVER_EXCEEDED_VALUE); | 494 problem, Histogram::NEVER_EXCEEDED_VALUE); |
495 } | 495 } |
496 | 496 |
497 void MetricsServiceBase::SnapshotProblemResolved(int amount) { | 497 void MetricsServiceBase::SnapshotProblemResolved(int amount) { |
498 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser", | 498 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser", |
499 std::abs(amount)); | 499 std::abs(amount)); |
500 } | 500 } |
501 | 501 |
| 502 HistogramSender::HistogramSender() {} |
| 503 |
| 504 HistogramSender::~HistogramSender() {} |
| 505 |
502 void HistogramSender::TransmitAllHistograms(Histogram::Flags flag_to_set, | 506 void HistogramSender::TransmitAllHistograms(Histogram::Flags flag_to_set, |
503 bool send_only_uma) { | 507 bool send_only_uma) { |
504 StatisticsRecorder::Histograms histograms; | 508 StatisticsRecorder::Histograms histograms; |
505 StatisticsRecorder::GetHistograms(&histograms); | 509 StatisticsRecorder::GetHistograms(&histograms); |
506 for (StatisticsRecorder::Histograms::const_iterator it = histograms.begin(); | 510 for (StatisticsRecorder::Histograms::const_iterator it = histograms.begin(); |
507 histograms.end() != it; | 511 histograms.end() != it; |
508 ++it) { | 512 ++it) { |
509 (*it)->SetFlags(flag_to_set); | 513 (*it)->SetFlags(flag_to_set); |
510 if (send_only_uma && | 514 if (send_only_uma && |
511 0 == ((*it)->flags() & Histogram::kUmaTargetedHistogramFlag)) | 515 0 == ((*it)->flags() & Histogram::kUmaTargetedHistogramFlag)) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 snapshot.Subtract(*already_logged); | 566 snapshot.Subtract(*already_logged); |
563 } | 567 } |
564 | 568 |
565 // Snapshot now contains only a delta to what we've already_logged. | 569 // Snapshot now contains only a delta to what we've already_logged. |
566 if (snapshot.redundant_count() > 0) { | 570 if (snapshot.redundant_count() > 0) { |
567 TransmitHistogramDelta(histogram, snapshot); | 571 TransmitHistogramDelta(histogram, snapshot); |
568 // Add new data into our running total. | 572 // Add new data into our running total. |
569 already_logged->Add(snapshot); | 573 already_logged->Add(snapshot); |
570 } | 574 } |
571 } | 575 } |
OLD | NEW |