hekametrics

package module
v0.0.0-...-1ebf777 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2015 License: BSD-2-Clause Imports: 9 Imported by: 0

README

hekametrics

go-metrics -> mozilla heka

Documenation

Godoc

Usage

Send a native Heka protobuf with metrics stuffed into its fields every 4 seconds over UDP or TCP. hekametrics sets Logger to go-metrics, caller controls the Type field. Payload is left empty.

client, err := NewHekaClient("tcp://localhost:5565", "teststats")
if err != nil {
	panic(err)
}
go client.LogHeka(metrics.DefaultRegistry, time.Second*4)

Documentation

Overview

Package hekametrics adds an output for https://github.com/rcrowley/go-metrics/

hekametrics encodes all metrics from a registry into a Heka protobuf message and sends to a Heka server on it's native listener port.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HekaClient

type HekaClient struct {
	// contains filtered or unexported fields
}

func NewHekaClient

func NewHekaClient(connect, msgtype string) (hc *HekaClient, err error)

NewHekaClient creates and returns a HekaClient

connect string like 'tcp://127.0.0.1:5564' and 'udp://127.0.0.1:5564'

msgtype sets the 'Type' field on a Heka message

func (*HekaClient) LogHeka

func (hc *HekaClient) LogHeka(r metrics.Registry, d time.Duration)

LogHeka is a blocking exporter function which encodes and sends metrics to a Heka server

all metrics in metrics.Registry r are stored on message.Message.Fields

flushing them every Duration d

func (*HekaClient) Stop

func (hc *HekaClient) Stop()

Stops LogHeka from another goroutine

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL