Skip to content

Commit e0b8a0d

Browse files
authored
Merge pull request #83 from olle/move-events-into-docs
Move events into docs
2 parents 0b046a7 + ecdac27 commit e0b8a0d

File tree

3 files changed

+48
-55
lines changed

3 files changed

+48
-55
lines changed

docs/events.adoc

Lines changed: 0 additions & 55 deletions
This file was deleted.

xdocs/.vitepress/config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export default defineConfig({
4646
text: "Maturity Model",
4747
link: "/reference/query-response-maturity-model",
4848
},
49+
{
50+
text: "Events",
51+
link: "/reference/events",
52+
}
4953
],
5054
},
5155
],

xdocs/reference/events.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Query/Response Events
2+
3+
## Metrics or "Stats"
4+
5+
Participating nodes in a Query/Response topology will broadcast events of structured statistics for the UI and monitoring applications to consume. The common data-shape encapsulates a way to communicate measurements, events, and node-identifying and describing meta-data.
6+
7+
The entry structure and format is encoded as a JSON UTF-8 encoded string.
8+
9+
```json
10+
{
11+
"elements": [
12+
{
13+
"key": "<string>",
14+
"value": "<string|number|boolean>",
15+
"timestamp": "<OPTIONAL:number>",
16+
"uuid": "<OPTIONAL:string>"
17+
}
18+
// ...
19+
]
20+
}
21+
```
22+
23+
The `key` and `value` property pairs are used to encode any measurement. The `timestamp` is an optional property, that can be used to associate a measurement with a point in time since the EPOCH, in milliseconds.
24+
25+
The `uuid` property is used to identify the publishing node during its lifetime—effectively creating an aggregate for statistics to present. This means that in practice there are operational metrics which may _come and go_ as well as logical statistics which may pertain to the topology or cluster of nodes.
26+
27+
### Table of published statistics
28+
29+
| Key | Value | Timestamp | UUID | Description |
30+
|---------------------------|---------|-----------|--------|-----------------------------------------------------------------------------|
31+
| `name` | string | - || Name or identity of the node, or `application` |
32+
| `pid` | string | - || Node process id, or `-` |
33+
| `host` | string | - || Node hostname, or `unknown` |
34+
| `uptime` | string | - || Node uptime, or `-` |
35+
| `only_responses` | boolean | - || Whether node has only responded `true`, or published queries `false` |
36+
| `count_queries` | number | - || Number of published queries |
37+
| `count_consumed_responses`| number | - || Number of consumed responses |
38+
| `count_published_responses`| number | - || Number of published responses |
39+
| `count_fallbacks` | number | - || Number of _fallbacks_ (no responses) |
40+
| `max_latency` | number | - || Largest recorded time between query and response, in milliseconds |
41+
| `min_latency` | number | - || Smallest recorded time between query and response, in milliseconds |
42+
| `avg_latency` | number | - || Average time between query and response, in milliseconds |
43+
| `throughput_queries` | number ||| Number of queries published, since last notification |
44+
| `throughput_responses` | number ||| Number of responses consumed, since last notification |

0 commit comments

Comments
 (0)