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 (*Receiver) Report ¶
func (r *Receiver) Report()
Keep an eye on the lenghts of our bufferes. If they are maxed out, something is going wrong.
Click to show internal directories.
Click to hide internal directories.