Documentation ¶
Overview ¶
Package metrics includes data types used for Golang runtime and system metrics collection
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectRuntime ¶
func CollectRuntime(ctx context.Context, opts CollectOptions) error
CollectRuntime starts a blocking background process that that collects metrics about the current process, the go runtime, and the underlying system.
Types ¶
type CollectOptions ¶
type CollectOptions struct { OutputFilePrefix string SampleCount int FlushInterval time.Duration CollectionInterval time.Duration SkipGolang bool SkipSystem bool SkipProcess bool Collectors Collectors RunParallelCollectors bool }
CollectOptions are the settings to provide the behavior of the collection process process.
func NewCollectOptions ¶
func NewCollectOptions(prefix string) CollectOptions
NewCollectOptions creates a valid, populated collection options structure, collecting data every minute, rotating files every 24 hours.
func (CollectOptions) Validate ¶
func (opts CollectOptions) Validate() error
Validate checks the Collect option settings and ensures that all values are reasonable.
type Collectors ¶
type Collectors []CustomCollector
func (Collectors) Len ¶
func (c Collectors) Len() int
func (Collectors) Less ¶
func (c Collectors) Less(i, j int) bool
func (Collectors) Swap ¶
func (c Collectors) Swap(i, j int)
type CustomCollector ¶
type Runtime ¶
type Runtime struct { ID int `json:"id" bson:"id"` Timestamp time.Time `json:"ts" bson:"ts"` PID int `json:"pid" bson:"pid"` Golang *message.GoRuntimeInfo `json:"golang,omitempty" bson:"golang,omitempty"` System *message.SystemInfo `json:"system,omitempty" bson:"system,omitempty"` Process *message.ProcessInfo `json:"process,omitempty" bson:"process,omitempty"` }
Runtime provides an aggregated view for
func (*Runtime) MarshalBSON ¶
func (*Runtime) UnmarshalBSON ¶
Click to show internal directories.
Click to hide internal directories.