This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "William K.L. Dickson", | |
"birth": "1860-08-03", | |
"films": [ | |
{ | |
"imdbID": 1, | |
"title": "Carmencita", | |
"year": 1894, | |
"director": "William K.L. Dickson", | |
"rating": "NOT RATED", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Louis Lumière", | |
"birth": "1864-10-05", | |
"films": [ | |
{ | |
"imdbID": 10, | |
"title": "Employees Leaving the Lumière Factory", | |
"year": 1895, | |
"runtime": "1 min", | |
"genre": "Documentary, Short", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SAMPLING_INTERVAL=5 | |
GRAPHITE_SERVER="127.0.0.1" | |
GRAPHITE_CARBON_PAINTEXT_PORT=2003 | |
LC_ALL=C \ | |
sar -d $SAMPLING_INTERVAL | \ | |
gawk -vhostname="$(hostname)" '{ | |
if (NF == 10 && $2 != "DEV") { | |
timestamp = systime(); | |
printf("%s.%s.rd_sec %s %d\n", hostname, $2, $4, timestamp); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
import time | |
import socket | |
import pickle | |
import struct | |
import fileinput | |
import calendar | |
CARBON_CACHE_SERVER = '127.0.0.1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SAMPLING_INTERVAL=5 | |
GRAPHITE_SERVER="127.0.0.1" | |
GRAPHITE_CARBON_PAINTEXT_PORT=2003 | |
LC_ALL=C \ | |
sar -d $SAMPLING_INTERVAL | \ | |
gawk -vhostname="$(hostname)" '{ | |
if (NF == 10 && $2 != "DEV") { | |
timestamp = systime(); | |
printf("%s.%s.rd_sec %s %d\n", hostname, $2, $4, timestamp); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import prometheus_client | |
import time | |
import psutil | |
UPDATE_PERIOD = 300 | |
SYSTEM_USAGE = prometheus_client.Gauge('system_usage', | |
'Hold current system resource usage', | |
['resource_type']) | |
if __name__ == '__main__': |