blob: b05d93378bd0019dac76a01ffa1a561ad578c3f3 [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);
James Kuszmaul79b2f032023-06-02 21:02:27 -070016 // Count of the total number of retries attempted on this channel.
17 retry_count:uint (id: 3);
James Kuszmaula6681e22023-05-26 11:20:40 -070018}
19
Austin Schuhe84c3ed2019-12-14 15:29:48 -080020// State of the connection.
21enum State: ubyte {
22 CONNECTED,
23 DISCONNECTED,
24}
25
26// Statistics from a single connection to a client from this server.
27table ServerConnection {
28 // The node that we are connected to.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080029 node:Node (id: 0);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080030
31 // Health of this connection. Connected or not?
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080032 state:State (id: 1);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080033
34 // Number of packets that have been dropped (if known).
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080035 dropped_packets:uint (id: 2);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080036
Austin Schuh40f4c472021-03-31 21:28:44 -070037 // Number of packets sent on all channels.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080038 sent_packets:uint (id: 3);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080039
Austin Schuh7bc59052020-02-16 23:48:33 -080040 // This is the measured monotonic offset for the connected node in
41 // nanoseconds. Add this to our monotonic time to get their
42 // monotonic time.
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080043 monotonic_offset:int64 (id: 4);
Austin Schuh7bc59052020-02-16 23:48:33 -080044
Austin Schuh20ac95d2020-12-05 17:24:19 -080045 // Boot UUID of the client.
46 boot_uuid:string (id: 5);
47
Austin Schuh40f4c472021-03-31 21:28:44 -070048 // Number of extra calls needed to receive a single message
49 // (indicates congestion)
50 partial_deliveries:uint (id: 6);
51
Austin Schuh367a7f42021-11-23 23:04:36 -080052 // Time at which we connected to the client as nanoseconds on the local
53 // monotonic clock. This is not populated when not connected, and defaults
54 // to monotonic_clock::min_time.
55 connected_since_time:int64 = -9223372036854775808 (id: 7);
56
57 // Number of times we've established a connection to the server.
58 connection_count:uint (id: 8);
Austin Schuhb0e439d2023-05-15 10:55:40 -070059
60 // Number of times we've had an invalid connection with something wrong in
61 // the connection message, but we were able to match which node it was.
62 invalid_connection_count:uint (id: 9);
James Kuszmaula6681e22023-05-26 11:20:40 -070063
64 // Statistics for every channel being forwarded to this node. Ordering is arbitrary;
65 // the channels are identified by an index in the ServerChannelStatistics.
66 channels:[ServerChannelStatistics] (id: 10);
James Kuszmaul79b2f032023-06-02 21:02:27 -070067
68 // Total number of retries attempted on all channels. Typically due to kernel
69 // send buffers filling up.
70 retry_count:uint (id: 11);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080071}
72
73// Statistics for all connections to all the clients.
74table ServerStatistics {
Ravago Jonesfb6a7a52020-11-14 13:47:46 -080075 connections:[ServerConnection] (id: 0);
milind1f1dca32021-07-03 13:50:07 -070076
77 // Count of timestamp send failures
78 timestamp_send_failures:uint64 (id: 1);
Austin Schuhb0e439d2023-05-15 10:55:40 -070079
80 // Number of times we've had an invalid connection with something wrong in
81 // the connection message. The most likely cause is that the config sha256
82 // doesn't match between nodes.
83 invalid_connection_count:uint (id: 2);
Austin Schuhe84c3ed2019-12-14 15:29:48 -080084}
85
86root_type ServerStatistics;