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

Unified Diff: mojo/services/test_service/toy_monitoring_service.mojom

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, 6 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
Index: mojo/services/test_service/toy_monitoring_service.mojom
diff --git a/mojo/services/test_service/toy_monitoring_service.mojom b/mojo/services/test_service/toy_monitoring_service.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..722953485d21e678f06d41c5f7d90f4d6a88be77
--- /dev/null
+++ b/mojo/services/test_service/toy_monitoring_service.mojom
@@ -0,0 +1,45 @@
+// 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.
+
+module mojo.test {
+
+// Various counters that services can periodically send to a
+// ToyMonitoringService for recording.
+struct ServiceStats {
+ uint64 num_new_requests;
+ double health;
+};
+
+// A per-service summary of all the ServiceStats the ToyMonitoringService has
+// observed.
+struct ServiceReport {
+ string service_name;
+ uint64 total_requests;
+ double mean_health;
+};
+
+// A simple interface to obtain a "report" from all services that have
+// opted to connect themselves for monitoring.
+interface ToyMonitoringService {
+ GetReport() => (ServiceReport[] report);
+};
+
+// ToyMonitoringServiceStatsRecorder records ServiceStats for an individual
+// service connection for aggregation in a ToyMonitoringService.
+[Client=ToyMonitoringServiceStatsUploader]
+interface ToyMonitoringServiceStatsRecorder {
+ // Upload a ServiceStats for monitoring.
+ RecordStats(uint64 client_id,
+ ServiceStats stats);
+};
+
+// The client-side contract for uploading ServiceStats to a
+// ToyMonitoringServiceStatsRecorder.
+interface ToyMonitoringServiceStatsUploader {
+ const uint64 kInvalidId = 0;
+ // Handshake to tell the client its global identifier and get the name.
+ SetIdAndReturnName(uint64 id) => (string service_name);
+};
+
+} // module mojo.test

Powered by Google App Engine
This is Rietveld 408576698