Skip to content

YannMoisan/graphite4s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphite4s

Build status Maven Central License

A library for sending points to graphite.

Project goals

The aim is to provide a lightweight graphite client.

This library respects referentially transparency and is agnostic of effect type.

Getting started

Add the dependency to your project:

libraryDependencies += "com.yannmoisan" %% "graphite4s" % Version

Usage

import java.time.Instant
import cats.effect._

object Example extends IOApp.Simple {
  override def run: IO[Unit] = {
    val graphite = new BatchGraphite(new JavaTCPClient[IO]("localhost", 2003))
    (for {
      now <- Clock[IO].realTime
      req <- graphite.send(GraphitePoint("path", 42.0, Instant.ofEpochMilli(now.toMillis)))
    } yield req)
  }
}