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

Unified Diff: cc/base/histograms.h

Issue 1135073002: Revert "cc: Add UMA stats for record and raster time." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/base/BUILD.gn ('k') | cc/base/histograms.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/histograms.h
diff --git a/cc/base/histograms.h b/cc/base/histograms.h
deleted file mode 100644
index 6f42428efb9943b1362afe871a719fa5c4bc1cc8..0000000000000000000000000000000000000000
--- a/cc/base/histograms.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CC_BASE_HISTOGRAMS_H_
-#define CC_BASE_HISTOGRAMS_H_
-
-#include "base/compiler_specific.h"
-#include "base/metrics/histogram_base.h"
-#include "base/metrics/histogram_macros.h"
-#include "base/numerics/safe_math.h"
-#include "base/time/time.h"
-#include "base/timer/elapsed_timer.h"
-#include "cc/base/cc_export.h"
-
-namespace cc {
-
-// Emits UMA histogram trackers for time spent as well as area (in pixels)
-// processed per unit time. Time is measured in microseconds, and work in
-// pixels per millisecond.
-//
-// Usage:
-// // Outside of a method, perhaps in a namespace.
-// DEFINE_SCOPED_UMA_HISTOGRAM_AREA_TIMER(ScopedReticulateSplinesTimer,
-// "ReticulateSplinesUs",
-// "ReticulateSplinesPixelsPerMs");
-//
-// // Inside a method.
-// ScopedReticulateSplinesTimer timer;
-// timer.AddArea(some_rect.size().GetArea());
-#define DEFINE_SCOPED_UMA_HISTOGRAM_AREA_TIMER(class_name, time_histogram, \
- area_histogram) \
- class class_name : public ::cc::ScopedUMAHistogramAreaTimerBase { \
- public: \
- ~class_name(); \
- }; \
- class_name::~class_name() { \
- Sample time_sample; \
- Sample area_sample; \
- GetHistogramValues(&time_sample, &area_sample); \
- UMA_HISTOGRAM_COUNTS(time_histogram, time_sample); \
- UMA_HISTOGRAM_COUNTS(area_histogram, area_sample); \
- }
-
-class CC_EXPORT ScopedUMAHistogramAreaTimerBase {
- public:
- void AddArea(int area) { area_ += area; }
- void SetArea(int area) { area_ = area; }
-
- protected:
- using Sample = base::HistogramBase::Sample;
-
- ScopedUMAHistogramAreaTimerBase();
- ~ScopedUMAHistogramAreaTimerBase();
-
- // Returns true if histograms should be recorded (i.e. values are valid).
- void GetHistogramValues(Sample* time_microseconds,
- Sample* pixels_per_ms) const;
-
- private:
- static void GetHistogramValues(base::TimeDelta elapsed,
- int area,
- Sample* time_microseconds,
- Sample* pixels_per_ms);
-
- base::ElapsedTimer timer_;
- base::CheckedNumeric<int> area_;
-
- friend class ScopedUMAHistogramAreaTimerBaseTest;
- DISALLOW_COPY_AND_ASSIGN(ScopedUMAHistogramAreaTimerBase);
-};
-
-} // namespace cc
-
-#endif // CC_BASE_HISTOGRAMS_H_
« no previous file with comments | « cc/base/BUILD.gn ('k') | cc/base/histograms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698