Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

organicveggie/metrics-statsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metrics-statsd

Statsd reporter for [codahale/metrics] (https://github.com/codahale/metrics).

Quick Start

The 3.x version of the Metrics library now uses the builder pattern to construct reporters. Below is an example of how to create a StatsdReporter and report out metrics every 15 seconds.

final Statsd statsd = new Statsd("localhost", port);

StatsdReporter reporter StatsdReporter.forRegistry(registry)
        .prefixedWith("foo")
        .convertDurationsTo(TimeUnit.MILLISECONDS)
        .convertRatesTo(TimeUnit.SECONDS)
        .filter(MetricFilter.ALL)
        .build(statsd);
reporter.start(15, TimeUnit.SECONDS);

If you are using Dropwizard (0.7.x +), there is an easy way to configure a Metrics reporter to be used directly from your YAML configuration file. See (https://github.com/dropwizard/dropwizard/tree/master/dropwizard-metrics-graphite) for an example of how to create a ReporterFactory.

Important Notes

Package Name & GroupId

As part of getting metrics-statsd ready for publishing to Maven Central, the Maven groupId changed from studyblue to com.bealetech. In addition, as of v2.3.0, the package name changed from com.studyblue to com.bealetech.

Version Numbers

Versions 2.1.3.0 and earlier directly matched the versioning of official releases of codahale/metrics. Future versions, starting with 2.2.0, will no longer match.

Setting Up Maven

Maven Repositories

Snapshots: https://oss.sonatype.org/content/repositories/snapshots
Releases: https://oss.sonatype.org/content/groups/public

Dependency

<dependencies>
    <dependency>
        <groupId>com.bealetech</groupId>
        <artifactId>metrics-statsd</artifactId>
        <version>${metrics-statsd.version}</version>
    </dependency>
</dependencies>

Compatability with metrics

metrics-statsd version metrics version
3.0.x 3.0.1
2.3.x 2.1.x
2.2.x 2.1.x
2.1.3 2.1.x

License

Copyright (c) 2012-2013 Sean Laurent

Published under Apache Software License 2.0, see LICENSE

About

Statsd reporter for codahale/metrics.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages