Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 1 | include "aos/configuration.fbs"; |
| 2 | |
| 3 | namespace aos.message_bridge; |
| 4 | |
| 5 | // State of the connection. |
| 6 | enum State: ubyte { |
| 7 | CONNECTED, |
| 8 | DISCONNECTED, |
| 9 | } |
| 10 | |
| 11 | // Statistics from a single connection to a client from this server. |
| 12 | table ServerConnection { |
| 13 | // The node that we are connected to. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 14 | node:Node (id: 0); |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 15 | |
| 16 | // Health of this connection. Connected or not? |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 17 | state:State (id: 1); |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 18 | |
| 19 | // Number of packets that have been dropped (if known). |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 20 | dropped_packets:uint (id: 2); |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 21 | |
Austin Schuh | 40f4c47 | 2021-03-31 21:28:44 -0700 | [diff] [blame] | 22 | // Number of packets sent on all channels. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 23 | sent_packets:uint (id: 3); |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 24 | |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 25 | // This is the measured monotonic offset for the connected node in |
| 26 | // nanoseconds. Add this to our monotonic time to get their |
| 27 | // monotonic time. |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 28 | monotonic_offset:int64 (id: 4); |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 29 | |
Austin Schuh | 20ac95d | 2020-12-05 17:24:19 -0800 | [diff] [blame] | 30 | // Boot UUID of the client. |
| 31 | boot_uuid:string (id: 5); |
| 32 | |
Austin Schuh | 40f4c47 | 2021-03-31 21:28:44 -0700 | [diff] [blame] | 33 | // Number of extra calls needed to receive a single message |
| 34 | // (indicates congestion) |
| 35 | partial_deliveries:uint (id: 6); |
| 36 | |
Austin Schuh | 367a7f4 | 2021-11-23 23:04:36 -0800 | [diff] [blame] | 37 | // Time at which we connected to the client as nanoseconds on the local |
| 38 | // monotonic clock. This is not populated when not connected, and defaults |
| 39 | // to monotonic_clock::min_time. |
| 40 | connected_since_time:int64 = -9223372036854775808 (id: 7); |
| 41 | |
| 42 | // Number of times we've established a connection to the server. |
| 43 | connection_count:uint (id: 8); |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | // Statistics for all connections to all the clients. |
| 47 | table ServerStatistics { |
Ravago Jones | fb6a7a5 | 2020-11-14 13:47:46 -0800 | [diff] [blame] | 48 | connections:[ServerConnection] (id: 0); |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame] | 49 | |
| 50 | // Count of timestamp send failures |
| 51 | timestamp_send_failures:uint64 (id: 1); |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | root_type ServerStatistics; |