Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultMetricBatchSize is default size of metrics batch size. DefaultMetricBatchSize = 2000 // DefaultMetricBufferLimit is default number of metrics kept. It should be a multiple of batch size. DefaultMetricBufferLimit = 10000 // FlushLoggingInitial XXX FlushLoggingInitial = 5 // FlushLoggingPeriod XXX FlushLoggingPeriod = 20 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is an object for storing metrics in a circular buffer.
func NewBuffer ¶
NewBuffer returns a Buffer
size is the maximum number of metrics that Buffer will cache. If Add is called when the buffer is full, then the oldest metric(s) will be dropped.
func (*Buffer) Batch ¶
Batch returns a batch of metrics of size batchSize. the batch will be of maximum length batchSize. It can be less than batchSize, if the length of Buffer is less than batchSize.
Click to show internal directories.
Click to hide internal directories.