Thuum Playground
Metric Broker
A programmer's calculator for the Metric Broker: build Tags, encode values, compose and decode frames byte by byte, then publish, subscribe and query the real broker.
Fields: countopgroupidx digity digitxycode
A Tag is 16 bits: an x digit, a y digit (together, the dtype) and an id. Pick or type any part; the rest follows. Docs ↗
- x digit
- 3 · sns · time in ns, set by the server, rounded down to the nanosecond · x in a pub: 0 B, in meas: 8 B
- y digit
- E · f32 · float, 4 B · kk 11 ww 10
- id
- 01 · 1
- on the wire
- 013 E little-endian: the id byte first, then the dtype
- address
- "C84A:3E01" the address of this Tag in your sandbox's Group C84A: JSON and REST name one series this way 4AC8013 E on the wire: the Group's two bytes, then the Tag's (little-endian)
- dtype
- sns_f32 · pub 9 B · meas 17 B · mb_data_tf
- Tags of this dtype
- 3E00–3EFF (15872–16127)
- interpolation
- step-hold · linear · spline Docs ↗
Type x and y the way people write them, and see the bytes the Tag's dtype puts on the wire. Docs ↗
x sns time in ns, set by the server, rounded down to the nanosecond
The server sets x when the pub arrives, rounded down to the nanosecond.
Required.
y f32 float, 4 B
You may write what you typed: the broker rounds it to the nearest f32, and its replies carry this.
- kind
- normal
- sign
- 0 ⇒ +
- exponent (8 bits)
- 123 − 127 ⇒ 2-4
- significand
- 1 + 5033165 / 223 = 1.60000002384185791015625
- value stored
- +2-4 × 1.60000002384185791015625 = 0.100000001490116119384765625
- typed
- 0.1
- stored − typed
- 0.000000001490116119384765625
Compose a message from ops and see it whole: count, then each op, every byte annotated. Next to it, the same message in JSON, and the size of each. Docs ↗
bytes · the binary encoding, byte by byte
json · the same message as text Docs ↗
Paste a frame, as hex, bits or JSON, and get it back field by field. A malformed frame is decoded up to its first error, which is pointed at: the byte, the field and why. Docs ↗
Two real connections to the Metric Broker, one per encoding, on your sandbox's Group C84A. Subscribe both, publish from one: the other receives the same measurement. Every frame below was on the wire. Docs ↗
- sent
- 0 frames · 0 B
- received
- 0 frames · 0 B
- sent
- 0 frames · 0 B
- received
- 0 frames · 0 B
Send ops
Your Tokens only reach Group C84A: any other Group is refused by the broker itself (forbidden).
Connect first: the buttons above open each connection.
Send a frame by hand
A frame as you type it, sent as is, malformed or not: see what the broker does with it. A bad bytes frame closes the connection (1007); text on a bytes connection, or binary on a json one, closes it too (1003). Docs ↗
Measurements received
No measurements yet: subscribe a connection to the Group, then publish.
REST
Docs ↗x: none: the server sets it
POST /api/thuum/metric/data
{
"measurements": [
{
"address": "C84A:3E01",
"y": 21.5
}
]
}Frames
Every frame sent and received, newest first. Open one to see it byte by byte.
Nothing sent or received yet.
A shared demo on Thuum's own Domain: data is kept for 24 hours, at most 1000 points per Group. Don't put anything private here. Docs ↗