| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module mojo.test; | 5 module mojo.test; |
| 6 | 6 |
| 7 // Various counters that services can periodically send to a | 7 // Various counters that services can periodically send to a |
| 8 // TestTrackedRequestService for recording. | 8 // TestTrackedRequestService for recording. |
| 9 struct ServiceStats { | 9 struct ServiceStats { |
| 10 uint64 num_new_requests; | 10 uint64 num_new_requests; |
| 11 double health; | 11 double health; |
| 12 }; | 12 }; |
| 13 | 13 |
| 14 // A per-service summary of all the ServiceStats the | 14 // A per-service summary of all the ServiceStats the |
| 15 // TestTrackedRequestService has observed. | 15 // TestTrackedRequestService has observed. |
| 16 struct ServiceReport { | 16 struct ServiceReport { |
| 17 string? service_name; | 17 string? service_name; |
| 18 uint64 total_requests; | 18 uint64 total_requests; |
| 19 double mean_health; | 19 double mean_health; |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 // A simple interface to obtain a "report" from all services that have | 22 // A simple interface to obtain a "report" from all services that have |
| 23 // opted to connect themselves to for request tracking. | 23 // opted to connect themselves to for request tracking. |
| 24 [ServiceName="mojo::test::TestTrackedRequestService"] |
| 24 interface TestTrackedRequestService { | 25 interface TestTrackedRequestService { |
| 25 GetReport() => (array<ServiceReport?>? report); | 26 GetReport() => (array<ServiceReport?>? report); |
| 26 }; | 27 }; |
| 27 | 28 |
| 28 // TestRequestTracker records ServiceStats for an individual service | 29 // TestRequestTracker records ServiceStats for an individual service |
| 29 // connection for aggregation in a TestTrackedRequestService. | 30 // connection for aggregation in a TestTrackedRequestService. |
| 31 [ServiceName="mojo::test::TestRequestTracker"] |
| 30 interface TestRequestTracker { | 32 interface TestRequestTracker { |
| 31 SetNameAndReturnId(string service_name) => (uint64 id); | 33 SetNameAndReturnId(string service_name) => (uint64 id); |
| 32 // Upload a ServiceStats for tracking. | 34 // Upload a ServiceStats for tracking. |
| 33 RecordStats(uint64 client_id, ServiceStats? stats); | 35 RecordStats(uint64 client_id, ServiceStats? stats); |
| 34 }; | 36 }; |
| OLD | NEW |