Git Product home page Git Product logo

go-collectd's Introduction

go-collectd

Utilities for using collectd together with Go.

Synopsis

package main

import (
    "context"
    "time"
    
    "collectd.org/api"
    "collectd.org/exec"
)

func main() {
    vl := api.ValueList{
        Identifier: api.Identifier{
            Host:   exec.Hostname(),
            Plugin: "golang",
            Type:   "gauge",
        },
        Time:     time.Now(),
        Interval: exec.Interval(),
        Values:   []api.Value{api.Gauge(42)},
    }
    exec.Putval.Write(context.Background(), &vl)
}

Description

This is a very simple package and very much a Work in Progress, so expect things to move around and be renamed a lot.

The repository is organized as follows:

  • Package collectd.org/api declares data structures you may already know from the collectd source code itself, such as ValueList.
  • Package collectd.org/exec declares some utilities for writing binaries to be executed with the exec plugin. It provides some utilities (getting the hostname, e.g.) and an executor which you may use to easily schedule function calls.
  • Package collectd.org/format declares functions for formatting ValueLists in other format. Right now, only PUTVAL is implemented. Eventually I plan to add parsers for some formats, such as the JSON export.
  • Package collectd.org/network implements collectd's binary network protocol. It offers client and server implementations, see network.Client and network.ListenAndWrite() for more details.

Install

To use this package in your own programs, simply use go get to fetch the packages you need, for example:

go get collectd.org/api

Author

Florian "octo" Forster <ff at octo.it>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.