Documentation ¶
Index ¶
- Constants
- Variables
- func Darwin() bool
- func Debug(msg string, args ...interface{})
- func DebugDebug(msg string, args ...interface{})
- func FileExists(path string) (bool, error)
- func Info(msg string, args ...interface{})
- func ReadLines(data []byte) ([]string, error)
- func SetLogLevel(level string)
- func Warn(msg string, args ...interface{})
- type RingBuffer
Constants ¶
const (
TimestampFormat = "2006-01-02T15:04:05.000000Z"
)
Variables ¶
var ( LogInfo = false LogDebug = false LogVerbose = false )
Functions ¶
func Debug ¶
func Debug(msg string, args ...interface{})
-l debug: Verbosity level which helps track down production issues
func DebugDebug ¶
func DebugDebug(msg string, args ...interface{})
-l verbose: Very verbose for development purposes
func FileExists ¶
func SetLogLevel ¶
func SetLogLevel(level string)
Types ¶
type RingBuffer ¶
type RingBuffer struct {
// contains filtered or unexported fields
}
Metrics are stored in a RingBuffer so we can keep history while also keeping the total storage constant. You can add things to a RingBuffer but you cannot remove them. Older items will be overwritten and garbage collected in time.
func NewRingBuffer ¶
func NewRingBuffer(capacity int) *RingBuffer
Return a RingBuffer with the given capacity.
func (*RingBuffer) Add ¶
func (buf *RingBuffer) Add(elem float64)
Add the given element to the buffer. Method will panic if the caller tries to store nil.
func (*RingBuffer) At ¶
func (buf *RingBuffer) At(idx int) *float64
Access the ring buffer based on previous elements added. 0 is the latest item, -1 is the previous one added, etc. This means that At(1) will give you the oldest item. Returns nil if the slot in the buffer has not been filled yet.
func (*RingBuffer) Capacity ¶
func (buf *RingBuffer) Capacity() int
func (*RingBuffer) Export ¶
func (buf *RingBuffer) Export() []float64
Export the set of values in the Ring Buffer, where the latest value will be last in the array. If the Buffer was not full, 0 will be exported.
func (*RingBuffer) Size ¶
func (buf *RingBuffer) Size() int