Documentation ¶
Overview ¶
Package pinba provides convenient wrapper to work with pinba (https://github.com/tony2001/pinba_extension) protobuf messages
Index ¶
- Constants
- type Request
- type Tag
- type Tags
- func (tags Tags) Filter(filter []string) Tags
- func (tags Tags) Get(key string) (string, error)
- func (tags Tags) GetMap() map[string]string
- func (tags Tags) Len() int
- func (tags Tags) Less(i, j int) bool
- func (tags Tags) String() string
- func (tags Tags) Stringf(format string) string
- func (tags Tags) Swap(i, j int)
- type Timer
- type Timers
Constants ¶
const MaxTags = 16
MaxTags is how many tags we can have. OpenTSDB limits it to 8, so let it be 16 :)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
Request wraps "raw" protobuf request and add convinient structs for Tags and Timers
func NewRequest ¶
NewRequest unmarshal protobuf packet from given data, and convert raw tags and timers data to Tags and Timers structs
type Tags ¶
type Tags []Tag
Tags is a list of tags
func (Tags) Filter ¶
Filter will filter (surprise :) tags by given keys, and return new Tags slice Code a bit strange, but that way we don't need to use append and it's almost twice as fast (480ns/op vs. 800ns/op)
func (Tags) String ¶
String will return tags as string such as "key=value key2=value2" Tags will be sorted by Key's