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

Side by Side Diff: components/rappor/sampler.h

Issue 1090683003: Alternative Multi-dimensional Rappor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_RAPPOR_SAMPLER_H_
6 #define COMPONENTS_RAPPOR_SAMPLER_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/containers/scoped_ptr_hash_map.h"
12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "components/rappor/rappor_parameters.h"
15 #include "components/rappor/sample.h"
16
17 namespace rappor {
18
19 class RapporReports;
20
21 class Sampler {
Alexei Svitkine (slow) 2015/04/16 15:09:44 Comment.
Steven Holte 2015/04/22 19:24:28 Done.
22 public:
23 Sampler();
24 ~Sampler();
25
26 void AddSample(const std::string& metric_name, scoped_ptr<Sample> sample);
27 void ExportMetrics(const std::string& secret, RapporReports* reports);
28 private:
29 std::map<std::string, int> sample_counts_;
30
31 // We keep all registered metrics in a map, from name to metric.
32 // The map owns the metrics it contains.
33 base::ScopedPtrHashMap<std::string, Sample> samples_;
34 DISALLOW_COPY_AND_ASSIGN(Sampler);
Alexei Svitkine (slow) 2015/04/16 15:09:43 Blank line above.
Steven Holte 2015/04/22 19:24:28 Done.
35 };
36
37 } // namespace rappor
38
39 #endif // COMPONENTS_RAPPOR_SAMPLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698