Code Monkey home page Code Monkey logo

dogstatsd-perl's Introduction

Build Status Coverage Status

NAME

DataDog::DogStatsd - A Perl client for DogStatsd

SYNOPSIS

    use DataDog::DogStatsd;

    my $statsd = DataDog::DogStatsd->new;
    $statsd->increment( 'user.login', { tags => [ $s->cs->param( 'loginName' ) ] } );
    $statsd->timing('page.load', 320);
    $statsd->gauge('users.online', 100);

    # namespace version
    my $statsd = DataDog::DogStatsd->new(namespace => 'account.'); # note the '.' at the ending
    $statsd->increment('activate'); # actually as account.activate

DESCRIPTION

Statsd: A DogStatsd client (https://www.datadoghq.com)

The difference between Net::Statsd and this is that it supports tags and namespace.

METHODS

new

  • host

    default to 127.0.0.1

  • port

    default to 8125

  • namespace

    default to ''

increment

    $statsd->increment( 'page.views' );
    $statsd->increment( 'test.stats', { sample_rate => 0.5 } );
    $statsd->increment( 'user.login', { tags => [ $s->cs->param( 'loginName' ) ] } );

Sends an increment (count = 1) for the given stat to the statsd server.

decrement

    $statsd->decrement( 'products.available' );

Sends a decrement (count = -1) for the given stat to the statsd server.

count

    $statsd->count( 'test.stats', 2 );

Sends an arbitrary count for the given stat to the statsd server.

gauge

    $statsd->gauge('users.online', 100);
    $statsd->gauge('users.online', 100, { tags => ['tag1', 'tag2'] });

Sends an arbitary gauge value for the given stat to the statsd server.

This is useful for recording things like available disk space, memory usage, and the like, which have different semantics than counters.

histogram

    $statsd->histogram($stats, $value);

Sends a value to be tracked as a histogram to the statsd server.

timing

    $statsd->timing('page.load', 320);
    $statsd->timing('page.load', 320, { sample_rate => 0.5, tags => ['tag1', 'tag2'] });

Sends a timing (in ms) for the given stat to the statsd server. The sample_rate determines what percentage of the time this report is sent. The statsd server then uses the sample_rate to correctly track the average timing for the stat.

set

    $statsd->set('visitors.uniques', $user_id);

Sends a value to be tracked as a set to the statsd server.

event

    $statsd->event('event title', 'event text', { tags => ['tag1, 'tag2'] });
    $statsd->event('event title', 'event text', { tags => ['tag1', 'tag2'], alert_type => 'error'});

Sends an event indicating a specific incident occurring.

Use alert_type option to specify the kind of event, available options are error, warning, info, and success.

AUTHORS

Stefan Goethals [email protected]

dogstatsd-perl's People

Contributors

aminmarashi avatar chylli-deriv avatar fayland avatar jy-deriv avatar leedo avatar mohanad-deriv avatar nael-binary avatar tom-binary avatar torsten-deriv avatar zakame avatar zipkid avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.