OLD | NEW |
(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 module mojo.test { |
| 6 |
| 7 // Various counters that services can periodically send to a |
| 8 // ToyMonitoringService for recording. |
| 9 struct ServiceStats { |
| 10 uint64 num_new_requests; |
| 11 double health; |
| 12 }; |
| 13 |
| 14 // A per-service summary of all the ServiceStats the ToyMonitoringService has |
| 15 // observed. |
| 16 struct ServiceReport { |
| 17 string service_name; |
| 18 uint64 total_requests; |
| 19 double mean_health; |
| 20 }; |
| 21 |
| 22 // A simple interface to obtain a "report" from all services that have |
| 23 // opted to connect themselves for monitoring. |
| 24 interface ToyMonitoringService { |
| 25 GetReport() => (ServiceReport[] report); |
| 26 }; |
| 27 |
| 28 // ToyMonitoringServiceStatsRecorder records ServiceStats for an individual |
| 29 // service connection for aggregation in a ToyMonitoringService. |
| 30 [Client=ToyMonitoringServiceStatsUploader] |
| 31 interface ToyMonitoringServiceStatsRecorder { |
| 32 // Upload a ServiceStats for monitoring. |
| 33 RecordStats(uint64 client_id, |
| 34 ServiceStats stats); |
| 35 }; |
| 36 |
| 37 // The client-side contract for uploading ServiceStats to a |
| 38 // ToyMonitoringServiceStatsRecorder. |
| 39 interface ToyMonitoringServiceStatsUploader { |
| 40 const uint64 kInvalidId = 0; |
| 41 // Handshake to tell the client its global identifier and get the name. |
| 42 SetIdAndReturnName(uint64 id) => (string service_name); |
| 43 }; |
| 44 |
| 45 } // module mojo.test |
OLD | NEW |