| Index: mojo/services/test_service/monitoring_uploader.h
|
| diff --git a/mojo/services/test_service/monitoring_uploader.h b/mojo/services/test_service/monitoring_uploader.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5fdc338b02497fd4776d100ba0fd7e317270aae2
|
| --- /dev/null
|
| +++ b/mojo/services/test_service/monitoring_uploader.h
|
| @@ -0,0 +1,42 @@
|
| +// Copyright 2014 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 MOJO_SERVICES_TEST_SERVICE_MONITORING_UPLOADER_H_
|
| +#define MOJO_SERVICES_TEST_SERVICE_MONITORING_UPLOADER_H_
|
| +
|
| +#include "mojo/public/cpp/system/macros.h"
|
| +#include "mojo/services/test_service/toy_monitoring_service.mojom.h"
|
| +
|
| +namespace mojo {
|
| +namespace test {
|
| +
|
| +class MonitoringUploader : public ToyMonitoringServiceStatsUploader {
|
| + public:
|
| + MonitoringUploader(
|
| + ToyMonitoringServiceStatsRecorderPtr recorder,
|
| + const std::string& service_name,
|
| + const mojo::Callback<void()>& monitoring_connected_callback);
|
| + virtual ~MonitoringUploader();
|
| +
|
| + // Call whenever an event happens that you want to be recorded.
|
| + void RecordNewRequest();
|
| +
|
| + // ToyMonitoringServiceMonitoringUploader impl.
|
| + virtual void SetIdAndReturnName(
|
| + uint64_t id,
|
| + const mojo::Callback<void(mojo::String)>& callback) MOJO_OVERRIDE;
|
| +
|
| + private:
|
| + void SendStats();
|
| + uint64_t id_;
|
| + uint64_t requests_since_upload_;
|
| + const std::string service_name_;
|
| + ToyMonitoringServiceStatsRecorderPtr recorder_;
|
| + mojo::Callback<void()> monitoring_connected_callback_;
|
| +};
|
| +
|
| +} // namespace test
|
| +} // namespace mojo
|
| +
|
| +#endif // MOJO_SERVICES_TEST_SERVICE_MONITORING_UPLOADER_H_
|
|
|