A library for sending points to graphite.
The aim is to provide a lightweight graphite client.
This library respects referentially transparency and is agnostic of effect type.
Add the dependency to your project:
libraryDependencies += "com.yannmoisan" %% "graphite4s" % Version
import java.time.Instant
import cats.effect._
object Example {
implicit val clock: Clock[IO] = Clock.create[IO]
val graphite = new BatchGraphite(new JavaTCPClient("localhost", 2003))
(for {
now <- clock.realTime(MILLISECONDS)
req <- graphite.send(GraphitePoint("path", 42.0, Instant.ofEpochMilli(now)))
} yield req).unsafeRunSync()
}