-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Expand file tree
/
Copy pathserver.stats
More file actions
157 lines (116 loc) · 4.47 KB
/
Copy pathserver.stats
File metadata and controls
157 lines (116 loc) · 4.47 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<h2>Server Stats</h2>
HHVM collects stats by time slots. Each time slot is configured as
StatsSlotDuration seconds and server internally keeps StatsMaxSlot number
of slots. Inside each slot, we keep a set of stats. These stats include
one built-in ("hit") and many key-value pairs defined by different parts
of the system.
slot:
time:
hit: total counts
details:
key-value pair
key-value pair
key-value pair
...
<h2>Stats Query</h2>
To query stats aggregated into one list of key value pairs encoded in JSON
format, hit admin port with a URL like this,
http://[server]:8088/stats.kvp?keys=...&to=[t2]...
keys: (optional) comma delimited keys to query, each of which can be decorated
[key] just the key's value, e.g. "sql.conn"
[key]/hit average per page hit, e.g. "sql.conn/hit"
[key]/sec per second rate, e.g. "sql.conn/sec"
#[regex]# keys matching the regular expression
(omitted) all available keys
prefix: (optional) adds a prefix and '.' delimiter to all key names
<h2>Available Keys</h2>
1. SQL Stats:
(1) Connections
sql.conn: number of connections newly created
sql.reconn_new: number of connections newly created when trying to reconnect
sql.reconn_ok: number of connections re-picked up when trying to reconnect
sql.reconn_old: number of connections dropped when trying to reconnect
(2) Queries
sql.query: number of queries executed
sql.query.[table].[verb]: per table-verb stats
sql.query.[verb]: per verb stats, where [verb] can be one of these:
- select
- insert
- update
- replace
- delete
- begin
- commit
- rollback
- unknown
2. MemCache Stats:
mcc.madd: number of multi_add() calls
mcc.madd.count: total count of multi added keys
mcc.mreplace: number of multi_replace() calls
mcc.mreplace.count: total count of multi replaced keys
mcc.set: number of set() calls
mcc.add: number of add() calls
mcc.decr: number of decr() calls
mcc.incr: number of incr() calls
mcc.delete: number of delete() calls
mcc.delete_details: number of delete_details() calls
mcc.get: number of get() calls
mcc.mget: number of multi_get() calls
mcc.mget.count: total count of multi got keys
mcc.replace: number of replace() calls
mcc.set: number of set() calls
mcc.stats: number of stats() calls
3. APC Stats:
apc.miss: number of item misses
apc.hit: number of item hits
apc.write: number of writes
4. Memory Stats:
These two stats are only available when Google heap profler is turned on for
debugging purposes:
mem.malloc.peak: peak malloc()-ed memory
mem.malloc.leaked: leaked malloc()-ed memory
5. Page Sections:
page.wall.[section]: wall time a page section takes
page.cpu.[section]: CPU time a page section takes
mem.[section]: request-local memory that a page section takes
network.uncompressed: total bytes to be sent before compression
network.compressed: total bytes sent after compression
Section can be one of these:
- queuing
- all
- input
- invoke
- send
- psp
- rollback
- free
6. evhttp Stats:
- evhttp.hit used cached connection
- evhttp.hit.[address] used cached connection by URL
- evhttp.miss no cached connection available
- evhttp.miss.[address] no cached connection available by URL
- evhttp.close cached connection got closed
- evhttp.close.[address] cached connection got closed by URL
- evhttp.skip not set to use cached connection
- evhttp.skip.[address] not set to use cached connection by URL
7. Application Stats:
PHP page can collect application-defined stats by calling
hphp_stats($key, $count);
where $key is arbitrary and $count will be tallied across different calls of
the same key.
8. Special Keys:
hit: page hit
load: number of active worker threads
load-pct: integer percentage of number active worker threads / total
idle: number of idle worker threads
<h2>Example URL</h2>
GET "http://localhost:8088/stats.kvp?prefix=hphp" \
"&keys=apc.hit/sec,hit,load,:sql.query..*.select:," \
"network.compressed/hit,hit/sec"
This URL queries the following data:
hit: page hits
hit/sec: request per second
apc.hit/sec: APC hit per second
load: number of active threads currently
network.compressed/hit: sent bytes per request
:sql.query..*.select: all SELECTs on different tables