Skip to content

jbuchbinder/gorrd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gorrd

Build Status

Simple Go interface for librrd library.

Installation

  1. Make sure you have the a working Go environment. See the install instructions. gorrd will always compile on the release tag.
  2. git clone git://github.com/kpumuk/gorrd.git
  3. cd gorrd/rrd && go build && go test -v

Using in other projects

go install github.com/jbuchbinder/gorrd/rrd

Example

package main

import (
    "log"
    "fmt"
    "github.com/jbuchbinder/gorrd/rrd"
    "time"
)

func main() {
    err := rrd.Create("test.rrd", 10, time.Seconds() - 10, []string {
        "DS:ok:GAUGE:600:0:U",
        "RRA:AVERAGE:0.5:1:25920",
    })
    if err != nil { log.Exitf("Error: %s", err) }
    
    err = rrd.Update("test.rrd", "ok", []string {
        fmt.Sprintf("%d:%d", time.Seconds(), 15),
    })
    if err != nil { log.Exitf("Error: %s", err) }
    
    log.Stdout("Everything is OK")
}

To run the application, put the code in a file called rrdtest.go and run:

8g rrdtest.go && 8l -o rrdtest rrdtest.8 && ./rrdtest

About

Go bindings for librrd

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%