-
Notifications
You must be signed in to change notification settings - Fork 0
/
key.go
38 lines (34 loc) · 1.01 KB
/
key.go
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
package main
const (
COUNTER = "counter"
GAUGE = "gauge"
)
var globalStatusKeys = map[string]string{
"Questions": COUNTER,
"Com_commit": COUNTER,
"Com_rollback": COUNTER,
"Com_begin": COUNTER,
"Com_select": COUNTER,
"Com_insert": COUNTER,
"Com_update": COUNTER,
"Com_delete": COUNTER,
"Com_repleace": COUNTER,
"Bytes_received": COUNTER,
"Bytes_send": COUNTER,
"Threads_running": GAUGE,
"Threads_connected": GAUGE,
"Aborted_connects": COUNTER,
"Open_tables": GAUGE,
"Opend_table": COUNTER,
}
var slaveStatusKey = map[string]string{
"Slave_IO_Running": GAUGE,
"Slave_SQL_Running": GAUGE,
"Seconds_Behind_Master": GAUGE,
}
type Metric struct {
Metric string `json:"metric"` //sys.cpu.idle
DataType string `json:"data_type"` //COUNTER,GAUGE,DERIVE
Value interface{} `json:"value"` //99.00
Tags map[string]string `json:"tags"` //{"product":"app01", "group":"dev02"}
}