forked from prometheus-community/bind_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstruct.go
More file actions
99 lines (83 loc) · 2.07 KB
/
struct.go
File metadata and controls
99 lines (83 loc) · 2.07 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package main
import (
"encoding/xml"
)
const (
qryRTT = "QryRTT"
)
type Zone struct {
Name string `xml:"name"`
Rdataclass string `xml:"rdataclass"`
Serial string `xml:"serial"`
//TODO a zone can also have a huge number of counters
// <counters>
}
type Stat struct {
Name string `xml:"name"`
Counter uint `xml:"counter"`
}
type View struct {
Name string `xml:"name"`
Cache []Stat `xml:"cache>rrset"`
Rdtype []Stat `xml:"rdtype"`
Resstat []Stat `xml:"resstat"`
Zones []Zone `xml:"zones>zone"`
}
//TODO expand
type Socket struct {
ID string `xml:"id"`
Name string `xml:"name"`
LocalAddress string `xml:"local-address"`
References uint `xml:"references"`
}
type Socketmgr struct {
References uint `xml:"references"`
Sockets []Socket `xml:"sockets>socket"`
}
type Task struct {
ID string `xml:"id"`
Name string `xml:"name"`
Quantum uint `xml:"quantum"`
References uint `xml:"references"`
State string `xml:"state"`
}
type ThreadModel struct {
Type string `xml:"type"`
WorkerThreads uint `xml:"worker-threads"`
DefaultQuantum uint `xml:"default-quantum"`
TasksRunning uint `xml:"tasks-running"`
}
type Taskmgr struct {
Tasks []Task `xml:"tasks>task"`
ThreadModel ThreadModel `xml:"thread-model"`
}
type QueriesIn struct {
Rdtype []Stat `xml:"rdtype"`
}
type Requests struct {
Opcode []Stat `xml:"opcode"`
}
type Server struct {
Requests Requests `xml:"requests"` //Most important stats
QueriesIn QueriesIn `xml:"queries-in"` //Most important stats
NsStats []Stat `xml:"nsstat"`
SocketStats []Stat `xml:"socketstat"`
ZoneStats []Stat `xml:"zonestats"`
}
type Memory struct {
//TODO
}
type Statistics struct {
Views []View `xml:"views>view"`
Socketmgr Socketmgr `xml:"socketmgr"`
Taskmgr Taskmgr `xml:"taskmgr"`
Server Server `xml:"server"`
Memory Memory `xml:"memory"`
}
type Bind struct {
Statistics Statistics `xml:"statistics"`
}
type Isc struct {
XMLName xml.Name `xml:"isc"`
Bind Bind `xml:"bind"`
}