Skip to content

Latest commit

 

History

History
47 lines (38 loc) · 1.25 KB

README.md

File metadata and controls

47 lines (38 loc) · 1.25 KB

bungee-statsd-client

Build Status

A statsd client library implemented in Java. Allows for Java applications to easily communicate with statsd. This is a fork adapted to use the BungeeCord Scheduler, because that one gets jealous of other executors very quickly.

Downloads

The client jar is distributed via a custom Maven repository.

<repository>
    <id>xxyy-public</id>
    <url>https://repo.l1t.li/xxyy-public/</url>
</repository>
<dependency>
    <groupId>me.minotopia</groupId>
    <artifactId>bungee-statsd-client</artifactId>
    <version>1.0.1</version>
</dependency>

Usage

import net.md_5.bungee.api.plugin.Plugin;
import com.timgroup.statsd.StatsDClient;
import com.timgroup.statsd.NonBlockingStatsDClient;

public class Foo extends Plugin {
  private final StatsDClient statsd = new NonBlockingStatsDClient("my.prefix", "statsd-host", 8125, this);

  @Override
  public void onEnable() {
    statsd.incrementCounter("bar");
    statsd.recordGaugeValue("baz", 100);
    statsd.recordExecutionTime("bag", 25);
    statsd.recordSetEvent("qux", "one");
  }
}