Lua graphite module for Tarantool 1.6+
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 27 commits ahead, 12 commits behind viciious:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
graphite
rockspecs
rpm
test
.travis.yml
AUTHORS
CHANGELOG.md
Dockerfile
Dockerfile.test
LICENSE
Makefile
README.md
example.lua

README.md

Build Status

Tarantool 1.6+ graphite module

Usage examples

local graphite = require('graphite')

-- initialize standard metrics, transmit them to graphite @ 192.168.1.2:3010
graphite.init('localhost.1_instance.', '192.168.1.2', 3010)

API

Configuration

--- Defaults are:
--- send_interval = 60
--- collect_interval = 1
graphite.configure({collect_interval = 5, send_interval = 30})

Metrics

-- adds new metric, values are probed every second by calling metric_fn, aggregated by calling aggr_fn on the series
graphite.add_sec_metric(name, metric_fn, aggr_fn)

graphite.sum_per_min(name, value)
graphite.sum_per_sec(name, value)
graphite.avg_per_min(name, value)
graphite.min_per_min(name, value)
graphite.max_per_min(name, value)
graphite.add(name, value) -- adds to current graphite metric value
graphite.inc(name) -- alias for graphite.add(name, 1)

Aggregation functions

Builtin aggregation functions to be used with add_sec_metric

graphite.sum
graphite.sum_per_sec
graphite.max
graphite.min
graphite.last

Transmission functions

-- transmits metric value to graphite
graphite.send(name, res, timestamp)

Usage examples

graphite.add_sec_metric('delete_rps_max', function() return box.stat().DELETE.rps end, graphite.max)
graphite.add('requests', 1)
graphite.max_per_min('max_mysql_query_time', query_time)