Graphite
- 시계열 데이터베이스중에 하나로써 Metric 정보를 저장하는 곳이 특화가 되어있는 데이터베이스이다.
- Graph Dashboard Grafana와 연동이 쉽다.
구성요소
- carbon : a Twisted daemon that listens for time-series data
- carbon-cache
- carbon-aggregator
- carbon-aggregator-cache
- carbon-relay
- whisper : a simple database library for storing time-series data
- graphite webapp : A Django webapp that renders graphs on-demand using Cairo
Install
docker run -d\
--name graphite\
--restart=always\
-p 80:80\
-p 2003-2004:2003-2004\
-p 2023-2024:2023-2024\
-p 8125:8125/udp\
-p 8126:8126\
graphiteapp/graphite-statsd
Plaintext Protocol
PORT=2003
SERVER=graphite.your.org
echo "local.random.diceroll 4 `date +%s`" | nc -c ${SERVER} ${PORT}
Python Pickle Protocol
payload = pickle.dumps(listOfMetricTuples, protocol=2)
header = struct.pack("!L", len(payload))
message = header + payload
Graphite Webapp Render API
# single server load on large graph
http://graphite/render?target=server.web1.load&height=800&width=600
# average load across web machines over last 12 hours
http://graphite/render?target=averageSeries(server.web*.load)&from=-12hours
# number of registered users over past day as raw json data
http://graphite/render?target=app.numUsers&format=json
# rate of new signups per minute
http://graphite/render?target=summarize(derivative(app.numUsers),"1min")&title=New_Users_Per_Minute
- format을 json으로 하며 json 형태의 데이터를 얻을수가 잇다.
Tool with graphite
- http://graphite.readthedocs.io/en/latest/tools.html
'Database > 시계열 데이터베이스' 카테고리의 다른 글
Grafana - 시계열 데이터 Dashbaord (0) | 2018.07.07 |
---|