blob: e93682881c48354b5d95566eb43cc2b17166ede3 [file] [log] [blame]
Austin Schuhe84c3ed2019-12-14 15:29:48 -08001include "aos/configuration.fbs";
2
3namespace aos.message_bridge;
4
James Kuszmaula6681e22023-05-26 11:20:40 -07005// Per-channel statistics for any channels being forwarded to other nodes by the
6// message bridge server.
7table ServerChannelStatistics {
8 // Index into the configuration channels list for this channel.
9 channel_index:uint64 (id: 0);
10 // Total number of messages that were sent (this does not necessarily
11 // mean that the message made it to the client).
12 sent_packets:uint (id: 1);
13 // Total number of messages that were dropped while sending (e.g.,
14 // those dropped by the kernel).
15 dropped_packets:uint (id: 2);
16}
17
Austin Schuhe84c3ed2019-12-14 15:29:48 -080018// State of the connection.
19enum State: ubyte {
20 CONNECTED,
21 DISCONNECTED,
22}
23
24// Statistics from a single connection to a client from this server.
25table ServerConnection {
26 // The node that we are connected to.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080027 node:Node (id: 0);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080028
29 // Health of this connection. Connected or not?
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080030 state:State (id: 1);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080031
32 // Number of packets that have been dropped (if known).
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080033 dropped_packets:uint (id: 2);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080034
Austin Schuh40f4c472021-03-31 21:28:44 -070035 // Number of packets sent on all channels.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080036 sent_packets:uint (id: 3);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080037
Austin Schuh7bc59052020-02-16 23:48:33 -080038 // This is the measured monotonic offset for the connected node in
39 // nanoseconds. Add this to our monotonic time to get their
40 // monotonic time.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080041 monotonic_offset:int64 (id: 4);
Austin Schuh7bc59052020-02-16 23:48:33 -080042
Austin Schuh20ac95d2020-12-05 17:24:19 -080043 // Boot UUID of the client.
44 boot_uuid:string (id: 5);
45
Austin Schuh40f4c472021-03-31 21:28:44 -070046 // Number of extra calls needed to receive a single message
47 // (indicates congestion)
48 partial_deliveries:uint (id: 6);
49
Austin Schuh367a7f42021-11-23 23:04:36 -080050 // Time at which we connected to the client as nanoseconds on the local
51 // monotonic clock. This is not populated when not connected, and defaults
52 // to monotonic_clock::min_time.
53 connected_since_time:int64 = -9223372036854775808 (id: 7);
54
55 // Number of times we've established a connection to the server.
56 connection_count:uint (id: 8);
Austin Schuhb0e439d2023-05-15 10:55:40 -070057
58 // Number of times we've had an invalid connection with something wrong in
59 // the connection message, but we were able to match which node it was.
60 invalid_connection_count:uint (id: 9);
James Kuszmaula6681e22023-05-26 11:20:40 -070061
62 // Statistics for every channel being forwarded to this node. Ordering is arbitrary;
63 // the channels are identified by an index in the ServerChannelStatistics.
64 channels:[ServerChannelStatistics] (id: 10);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080065}
66
67// Statistics for all connections to all the clients.
68table ServerStatistics {
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080069 connections:[ServerConnection] (id: 0);
milind1f1dca32021-07-03 13:50:07 -070070
71 // Count of timestamp send failures
72 timestamp_send_failures:uint64 (id: 1);
Austin Schuhb0e439d2023-05-15 10:55:40 -070073
74 // Number of times we've had an invalid connection with something wrong in
75 // the connection message. The most likely cause is that the config sha256
76 // doesn't match between nodes.
77 invalid_connection_count:uint (id: 2);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080078}
79
80root_type ServerStatistics;