You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The connector can be used in your application by requiring it as the first line of your application:
16
16
```sh
17
-
var appstatsd = require('appmetrics-statsd').Client();
17
+
var appstatsd = require('appmetrics-statsd').StatsD();
18
18
```
19
-
Configuration of the connection to the StatsD server is possible by passing parameters to the `Client()` function. These are passed directly though to the `StatsD` constructor in the `node-statsd` module. Information for that module is available here:
19
+
Configuration of the connection to the StatsD server is possible by passing parameters to the `StatsD()` function. These are passed directly though to the `StatsD` constructor in the `node-statsd` module. Information for that module is available here:
20
20
https://www.npmjs.com/package/node-statsd
21
21
22
22
Additional data may also be sent to StatsD using the standard `node-statsd` module Client APIs, eg.
23
23
24
24
```sh
25
25
var statsd = require('appmetrics-statsd').StatsD();
26
26
27
-
statsd.guage('gauge', 10.4);
27
+
statsd.gauge('gauge', 10.4);
28
28
```
29
29
30
30
### Data Provided
31
31
32
32
The connector sends the following data values to StatsD from Node Application Metrics:
33
-
#### Gauges
33
+
34
+
35
+
#### CPU
36
+
**Gauges**
37
+
38
+
*`cpu.process` the CPU usage of the application as a percentage of total machine CPU
39
+
*`cpu.system` the CPU usage of the system as a percentage of total machine CPU
40
+
41
+
#### System Memory
42
+
43
+
**Gauges**
44
+
34
45
*`memory.process.private` the amount of memory used by the Node.js application that cannot be shared with other processes, in bytes.
35
46
*`memory.process.physical` the amount of RAM used by the Node.js application in bytes.
36
47
*`memory.process.virtual` the memory address space used by Node.js application in bytes.
37
48
*`memory.system.used` the total amount of RAM in use on the system in bytes.
38
49
*`memory.system.total` the total amount of RAM available on the system in bytes.
50
+
51
+
####Event Loop
52
+
53
+
*`eventloop.latency.min` the shortest sampled latency for processing an event
54
+
*`eventloop.latency.max` the longest sampled latency for processing an event
55
+
*`eventloop.latency.avg` the mean sampled latency for processing an event
56
+
57
+
####Garbage Collection
58
+
59
+
**Gauges**
60
+
39
61
*`gc.size` the size of the JavaScript heap in bytes.
40
62
*`gc.used` the amount of memory used on the JavaScript heap in bytes.
41
63
42
-
#### Timers
64
+
**Timers**
65
+
43
66
*`gc.duration` the duration of the GC cycle in milliseconds.
44
67
68
+
####HTTP Requests
69
+
70
+
**Timers**
71
+
72
+
*`http` the time taken for the HTTP request to be responded to in ms.
73
+
74
+
####Socket.io
75
+
76
+
**Timers**
77
+
78
+
*`socketio.broadcast.<event>` the time taken for the broadcast to all clients of the named socketio event.
79
+
*`socketio.emit.<event>` the time taken for the emit to a single client of the named socketio event.
80
+
*`socketio.receive.<event>` the time taken for a received named socketio event to be handled.
81
+
82
+
####MySQL Queries
83
+
84
+
**Timers**
85
+
86
+
*`mysql` the time taken for the given MySQL query to be responded to in ms.
87
+
88
+
####MongoDB Queries
89
+
90
+
**Timers**
91
+
92
+
*`mongo` the time taken for the given MongoDB query to be responded to in ms.
93
+
94
+
####Leveldown Queries
95
+
96
+
**Timers**
97
+
98
+
*`levedown.get` the time taken for the Leveldown `get` to be responded to in ms.
99
+
*`levedown.put` the time taken for the Leveldown `put` to be responded to in ms.
100
+
*`levedown.del` the time taken for the Leveldown `del` to be responded to in ms.
101
+
*`levedown.batch` the time taken for the Leveldown `batch` to be run in ms.
102
+
103
+
####Redis Queries
104
+
105
+
**Timers**
106
+
107
+
*`redis.<cmd>` the time taken for the given Redis command to be responded to in ms.
108
+
109
+
####Memcached Operations
110
+
111
+
**Timers**
112
+
113
+
*`memcached.<method>` the time taken for the given Memcached method to be responded to in ms.
114
+
115
+
####PostgreSQL Queries
116
+
117
+
**Timers**
118
+
119
+
*`postgres` the time taken for the given PostgresSQL query to be responded to in ms.
120
+
121
+
####MQTT Messaging
122
+
123
+
**Timers**
124
+
125
+
*`mqtt.<method>.<topic>` the time taken for a MQTT message to handled on a given topic in ms.
126
+
127
+
####MQLight Messaging
128
+
129
+
**Timers**
130
+
131
+
*`mqlight.<method>.<topic>` the time taken for a MQLight message to handled on a given topic in ms.
132
+
45
133
### License
46
134
The Node Application Metrics to StatsD Connector is licensed using an Apache v2.0 License.
47
135
48
136
### Version
49
-
1.0.0
137
+
1.0.1
138
+
139
+
#### Version History
140
+
141
+
1.0.1 Add support for Event Loop, HTTP, Socketio, MongoDB, MySQL, Leveldown, Redis, Memcached, POstgreSQL, MQTT and MQLight
0 commit comments