stats

package
Version: v0.0.0-...-45f56e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Overview

Package stats collects serviced metrics and posts them to the TSDB.

Package stats collects serviced metrics and posts them to the TSDB.

Package stats collects serviced metrics and posts them to the TSDB.

Package stats collects serviced metrics and posts them to the TSDB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOpenFileDescriptorCount

func GetOpenFileDescriptorCount() (int64, error)

GetOpenFileDescriptorCount returns the number of open file descriptors for the process id of the caller.

func Post

func Post(destination string, stats []Sample) error

Post sends the list of stats to the TSDB.

Types

type Sample

type Sample struct {
	Metric    string            `json:"metric"`
	Value     string            `json:"value"`
	Timestamp int64             `json:"timestamp"`
	Tags      map[string]string `json:"tags"`
}

Sample is a single metric measurement

type ServicedStatsReporter

type ServicedStatsReporter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ServicedStatsReporter collects and posts serviced/docker stats to the TSDB.

func NewServicedStatsReporter

func NewServicedStatsReporter(destination string, interval time.Duration, conn coordclient.Connection, dockerClient docker.Docker) (*ServicedStatsReporter, error)

NewServicedStatsReporter creates a new ServicedStatsReporter and kicks off the reporting goroutine.

func (*ServicedStatsReporter) Close

func (sr *ServicedStatsReporter) Close()

Close shuts down the reporting goroutine.

type StatsReporterInterface

type StatsReporterInterface interface {
	Close()
	// contains filtered or unexported methods
}

StatsReporterInterface declares functions that may be useful for unit tests

type StorageStatsReporter

type StorageStatsReporter struct {
	// contains filtered or unexported fields
}

StorageStatsReporter collects and posts storage stats to the TSDB.

func NewStorageStatsReporter

func NewStorageStatsReporter(destination string, interval time.Duration) (*StorageStatsReporter, error)

NewStorageStatsReporter creates a new NewStorageStatsReporter and kicks off the reporting goroutine.

func (*StorageStatsReporter) Close

func (sr *StorageStatsReporter) Close()

Close shuts down the reporting goroutine.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL