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

Side by Side Diff: chrome/renderer/renderer_histogram_snapshots.h

Issue 27034: Initial support for Renderer Side Histograms... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/renderer.vcproj ('k') | chrome/renderer/renderer_histogram_snapshots.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_RENDERER_HISTOGRAM_SNAPSHOTS_H_
6 #define CHROME_RENDERER_HISTOGRAM_SNAPSHOTS_H_
7
8 #include <list>
9 #include <map>
10 #include <set>
11 #include <string>
12 #include <vector>
13
14 #include "base/basictypes.h"
15 #include "base/histogram.h"
16 #include "base/process.h"
17 #include "base/scoped_ptr.h"
18 #include "base/task.h"
19
20 class RendererHistogramSnapshots {
21 public:
22 RendererHistogramSnapshots();
23
24 ~RendererHistogramSnapshots() {}
25
26 // Send the histogram data.
27 void SendHistograms();
28
29 // Maintain a map of histogram names to the sample stats we've sent.
30 typedef std::map<std::string, Histogram::SampleSet> LoggedSampleMap;
31 typedef std::vector<std::string> HistogramPickledList;
32
33 private:
34 // Extract snapshot data and then send it off the the Browser process.
35 // Send only a delta to what we have already sent.
36 void UploadAllHistrograms();
37 void UploadHistrogram(const Histogram& histogram,
38 HistogramPickledList* histograms);
39 void UploadHistogramDelta(const Histogram& histogram,
40 const Histogram::SampleSet& snapshot,
41 HistogramPickledList* histograms);
42
43 ScopedRunnableMethodFactory<RendererHistogramSnapshots>
44 renderer_histogram_snapshots_factory_;
45
46 // For histograms, record what we've already logged (as a sample for each
47 // histogram) so that we can send only the delta with the next log.
48 LoggedSampleMap logged_samples_;
49
50 DISALLOW_COPY_AND_ASSIGN(RendererHistogramSnapshots);
51 };
52
53 #endif // CHROME_RENDERER_HISTOGRAM_SNAPSHOTS_H_
54
OLDNEW
« no previous file with comments | « chrome/renderer/renderer.vcproj ('k') | chrome/renderer/renderer_histogram_snapshots.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698