blob: d69e139ae8203aa0de24189cb3dc530d86b89c56 [file] [log] [blame]
// 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
// TestTrackedRequestService for recording.
struct ServiceStats {
uint64 num_new_requests;
double health;
};
// A per-service summary of all the ServiceStats the
// TestTrackedRequestService 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 to for request tracking.
interface TestTrackedRequestService {
GetReport() => (ServiceReport[] report);
};
// TestRequestTracker records ServiceStats for an individual service
// connection for aggregation in a TestTrackedRequestService.
[Client=TestRequestTrackerClient]
interface TestRequestTracker {
// Upload a ServiceStats for tracking.
RecordStats(uint64 client_id, ServiceStats stats);
};
// The client-side contract for uploading ServiceStats to TestRequestTracker.
interface TestRequestTrackerClient {
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