forked from tofu702/tofu702_varz_daemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PROTOCOL_SPECIFICATION
43 lines (36 loc) · 1.66 KB
/
PROTOCOL_SPECIFICATION
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
All commands are text strings. They generally take the form of some command, optionally followed
by some arguments. Commands are always terminated by a ';' which is illegal elsewhere in the
command.
Command Format
------------------
COMMAND = (<ADD_COMMAND> | <GET_COMMAND> | <CONTROL_COMMAND>) ";"
ADD_COMMAND = <ADD_OPERATION> <VARIABLE_NAME> <TIME> <VALUE>
ADD_OPERATIONS = "MHTCOUNTERADD" | "MHTSAMPLEADD"
VARIABLE_NAME =
# Strings consisting of alphanumeric and "_" up to length 128
TIME = [uint64]
# Seconds since the UNIX epoch
VALUE = [uint64]
# For counters, amount to increment the counter by
# For samples, the value of the sample
GET_COMMAND = "MHTCOUNTERGET"
CONTROL_COMMAND = "ALLDUMPJSON" | "ALLLISTJSON" | "ALLFLUSH"
Examples:
MHTCOUNTERADD lookup_request 1420960985123 2;
MHTSAMPLEADD lookup_request_latency_ms 1420960985123 231;
MHTCOUNTERGET lookup_request;
ALLDUMPJSON;
ALLLISTJSON;
ALLFLUSH;
JSON Output Format
------------------
ALL_DUMP_JSON = {"mht_counters": [<COUNTER_JSON_WRAPPER>], "mht_samplers": [<SAMPLER_JSON_WRAPPER>], "metadata":<DUMP_METADATA>}
ALL_LIST_JSON = {"mht_counters": [string], "mht_samplers": [string]}
COUNTER_JSON_WRAPPER = {"name": string, "value": <COUNTER_JSON>}
COUNTER_JSON = {"min_counters": [int], "all_time_count": int, "latest_time_sec": time_int}
DUMP_METADATA = {"start_time": time_int}
SAMPLER_JSON_WRAPPER = {"name": string, "value": <SAMPLER_JSON>}
SAMPLER_JSON = {"latest_time_sec": time_int, "last_minute_samples": <SAMPLE_SET_JSON>,
"all_time_samples": <SAMPLE_SET_JSON>}
SAMPLE_SET_JSON = {"sample_values": [int], "sample_times_sec": [int], "samples_size": int,
"num_events": int}