1// Copyright 2017 The Fuchsia 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
5library fuchsia.cobalt;
6
7// The Controller is primarily useful for testing the Cobalt service.
8// Cobalt clients should use the Logger.
9
10[Discoverable]
11interface Controller {
12    // Requests that the collection of Observations that are currently cached
13    // locally be sent to the Cobalt server soon. Cobalt will send the
14    // Observations in one or more batches and will retry several times upon
15    // failure. The response occurs only after that procedure is completed. A
16    // return value of true indicates that all Observations were successfully
17    // sent. A return value of false indicates otherwise.
18    1: RequestSendSoon() -> (bool success);
19
20    // The Cobalt FIDL service will block, not processing any further FIDL
21    // requests or responses, on either this interface or the Logger interface,
22    // until either |max_wait_seconds| have elapsed or the Cobalt service's
23    // worker thread has successfully sent all previously added Observations to
24    // the Shuffler. The response will be returned after the blocking period has
25    // ended. Note that this method does not request an expedited send and so it
26    // is possible that the worker thread is currently waiting for the next
27    // scheduled send time and so the empty state will not be achieved prior
28    // that time.
29    2: BlockUntilEmpty(uint32 max_wait_seconds) -> ();
30
31    // These diagnostic stats are mostly useful in a testing environment but
32    // may possibly prove useful in production also.
33    3: GetNumSendAttempts() -> (uint32 num);
34    4: GetFailedSendAttempts() -> (uint32 num);
35};
36