Skip to content

almariah/go-graphite-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-graphite-client

Package go-graphite-client is a simple client used to send mertics to graphite server using TCP or UDP. It could be used to send a single metric or batch of mertics.

Installation

To install go-graphite-client:

go get github.com/almariah/go-graphite-client

Examples

To send single metric:

To send batch of metrics:

Example:

package main

import (
  "github.com/almariah/go-graphite-client"
  "fmt"
)

func main() {

  // craete client
  client := &Client{
    Host: graphiteHost,
    Port: graphitePort,
    Protocol: TCP,
  }

  // connect a graphite server
  err := client.Connect()
  if err != nil {
    fmt.Println(err)
    os.Exit(1)
  }

  // send Metric
  client.Send("stats.test.metric", "1")         

}

Releases

No releases published

Packages

No packages published

Languages