Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jasei/net-statsite-client
https://github.com/jasei/net-statsite-client
module perl statsite
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/jasei/net-statsite-client
- Owner: JaSei
- License: other
- Created: 2016-08-26T14:13:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-01T15:03:20.000Z (almost 8 years ago)
- Last Synced: 2024-11-06T02:50:00.914Z (about 2 months ago)
- Topics: module, perl, statsite
- Language: Perl
- Size: 20.5 KB
- Stars: 0
- Watchers: 22
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/avast/Net-Statsite-Client.svg?branch=master)](https://travis-ci.org/avast/Net-Statsite-Client)
# NAMENet::Statsite::Client - Object-Oriented Client for [statsite](http://armon.github.io/statsite) server
# SYNOPSIS
use Net::Statsite::Client;
my $statsite = Net::Statsite::Client->new(
host => 'localhost',
prefix => 'test',
);$statsite->increment('item'); #increment key test.item
# DESCRIPTION
Net::Statsite::Client is based on [Etsy::StatsD](https://metacpan.org/pod/Etsy::StatsD) but with new - `new` interface and `unique` method.
# METHODS
## new (host => $host, port => $port, sample\_rate => $sample\_rate, prefix => $prefix)
Create a new instance.
_host_ - hostname of statsite server (default: localhost)
_port_ - port of statsite server (port: 8125)
_sample\_rate_ - rate of sends metrics (default: 1)
_prefix_ - prefix metric name (default: '')
_proto_ - protocol (default: 'udp')
## timing(STAT, TIME, SAMPLE\_RATE)
Log timing information (should be in miliseconds)
## increment(STATS, SAMPLE\_RATE)
Increment one of more stats counters.
## decrement(STATS, SAMPLE\_RATE)
Decrement one of more stats counters.
## update(STATS, DELTA, SAMPLE\_RATE)
Update one of more stats counters by arbitrary amounts.
## unique(STATS, ITEM, SAMPLE\_RATE)
Unique Set
For example if you need count of unique ip adresses (per flush interval)
$stats->unique('ip.unique', $ip);## gauge(STATS, VALUE, SAMPLE\_RATE)
Gauge Set (Gauge, similar to kv but only the last value per key is retained)
## send(DATA, SAMPLE\_RATE)
Sending logging data; implicitly called by most of the other methods.
# CONTRIBUTING
the easiest way is use docker ([avastsoftware/perl-extended](https://hub.docker.com/r/avastsoftware/perl-extended/) - with [Carton](https://metacpan.org/pod/Carton) and [Minilla](https://metacpan.org/pod/Minilla))
or [Carton](https://metacpan.org/pod/Carton) and `Minilla` itself (commands after `../perl-extended`)
carton (aka ruby bundle) for fetch dependency
docker run -v $PWD:/tmp/app -w /tmp/app avastsoftware/perl-extended carton
and minil test for tests and regenerate meta and readme
docker run -v $PWD:/tmp/app -w /tmp/app avastsoftware/perl-extended carton exec minil test
# LICENSE
Copyright (C) Avast Software.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.# AUTHOR
Jan Seidl