Added memcached_instance column to published data.
This commit is contained in:
parent
6ec25da58f
commit
b7954d7633
@ -48,9 +48,12 @@ Posting metrics to influxdb
|
||||
|
||||
## Querying data from InfluxDB
|
||||
|
||||
Simplest example:
|
||||
Simple example:
|
||||
|
||||
```sql
|
||||
SELECT value from memcached_rps;
|
||||
SELECT value from memcached_rps
|
||||
WHERE time > now() - 10m
|
||||
AND "memcached_instance"='localhost:11211'
|
||||
LIMIT 25;
|
||||
```
|
||||
|
||||
|
@ -144,16 +144,18 @@ def extract_rps(raw_stats):
|
||||
return requests_per_second
|
||||
|
||||
def post_to_influxdb(rps):
|
||||
global influxdb_endpoint
|
||||
global influxdb_endpoint, memcached_host, memcached_port
|
||||
|
||||
memcached_instance = "{}:{}".format(memcached_host, memcached_port)
|
||||
|
||||
print "Posting metrics to influxdb"
|
||||
samples = []
|
||||
|
||||
rps_sample = {
|
||||
"name": "memcached_rps",
|
||||
"columns": [ "value" ],
|
||||
"columns": [ "value", "memcached_instance" ],
|
||||
"points": [
|
||||
[rps]
|
||||
[rps, memcached_instance]
|
||||
]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user