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

Side by Side Diff: mojo/services/test_service/monitoring_uploader.h

Issue 349303006: mojo: add some end-to-end shell tests and a new test sample app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ServiceProvider rebase Created 6 years, 5 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
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 MOJO_SERVICES_TEST_SERVICE_MONITORING_UPLOADER_H_
6 #define MOJO_SERVICES_TEST_SERVICE_MONITORING_UPLOADER_H_
7
8 #include "mojo/public/cpp/system/macros.h"
9 #include "mojo/services/test_service/toy_monitoring_service.mojom.h"
10
11 namespace mojo {
12 namespace test {
13
14 class MonitoringUploader : public ToyMonitoringServiceStatsUploader {
15 public:
16 MonitoringUploader(
17 ToyMonitoringServiceStatsRecorderPtr recorder,
18 const std::string& service_name,
19 const mojo::Callback<void()>& monitoring_connected_callback);
20 virtual ~MonitoringUploader();
21
22 // Call whenever an event happens that you want to be recorded.
23 void RecordNewRequest();
24
25 // ToyMonitoringServiceMonitoringUploader impl.
26 virtual void SetIdAndReturnName(
27 uint64_t id,
28 const mojo::Callback<void(mojo::String)>& callback) MOJO_OVERRIDE;
29
30 private:
31 void SendStats();
32 uint64_t id_;
33 uint64_t requests_since_upload_;
34 const std::string service_name_;
35 ToyMonitoringServiceStatsRecorderPtr recorder_;
36 mojo::Callback<void()> monitoring_connected_callback_;
37 };
38
39 } // namespace test
40 } // namespace mojo
41
42 #endif // MOJO_SERVICES_TEST_SERVICE_MONITORING_UPLOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698