receiver

package
v0.0.0-...-de99981 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2014 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Receiver provides mechanisms to read log requests, extract measurements from log requests, aggregate measurements in buckets, and flush buckets into a memory store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogRequest

type LogRequest struct {
	// The body of the HTTP request.
	Body []byte
	// Options from the query parameters
	Opts map[string][]string
}

We read the body of an http request and then close the request. The processing of the body happens in a seperate routine. We use this struct to hold the data that is passed inbetween routines.

type Receiver

type Receiver struct {
	// Keeping a register allows us to aggregate buckets in memory.
	// This decouples redis writes from HTTP requests.
	Register *register
	// After we pull data from the HTTP requests,
	// We put the data in the inbox to be processed.
	Inbox chan *LogRequest
	// The interval at which things are moved fron the inbox to the outbox
	TransferTicker *time.Ticker
	// After we flush our register of buckets, we put the
	// buckets in this channel to be flushed to redis.
	Outbox chan *bucket.Bucket
	// Flush buckets from register to redis. Number of seconds.
	FlushInterval time.Duration
	// How many outlet routines should be running.
	NumOutlets int
	// Bucket storage.
	Store store.Store

	// Publish receiver metrics on this channel.
	Mchan *metchan.Channel
	// contains filtered or unexported fields
}

func NewReceiver

func NewReceiver(cfg *conf.D, s store.Store) *Receiver

func (*Receiver) Receive

func (r *Receiver) Receive(b []byte, opts map[string][]string)

func (*Receiver) Report

func (r *Receiver) Report()

Keep an eye on the lenghts of our bufferes. If they are maxed out, something is going wrong.

func (*Receiver) ServeHTTP

func (r *Receiver) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Receiver) Start

func (r *Receiver) Start()

Start moving data through the receiver's pipeline.

func (*Receiver) Wait

func (r *Receiver) Wait()

This function can be used as and indicator of when it is safe to shutdown the process.

Jump to

Keyboard shortcuts

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