batchinsights

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAggregationTime = time.Duration(1) * time.Minute

DefaultAggregationTime default time range where metrics are preaggregated locally

View Source
const DefaultSamplingRate = time.Duration(5) * time.Second

DefaultSamplingRate default time between metrics sampling

View Source
const Version = "1.3.0"

Version Batch insights version

Variables

This section is empty.

Functions

func GetMetricID added in v1.3.0

func GetMetricID(metric *appinsights.MetricTelemetry) string

GetMetricID compute an group id for this metric so it can be aggregated

func ListenForStats

func ListenForStats(config Config)

ListenForStats Start the sanpling of node metrics

func PrintSystemInfo

func PrintSystemInfo()

PrintSystemInfo print system info needed

Types

type AppInsightsService

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

AppInsightsService service handling the aggregation and upload of metrics

func NewAppInsightsService

func NewAppInsightsService(instrumentationKey string, poolID string, nodeID string, aggregation time.Duration) AppInsightsService

NewAppInsightsService create a new instance of the AppInsightsService

func (*AppInsightsService) UploadStats

func (service *AppInsightsService) UploadStats(stats NodeStats)

UploadStats will register the given stats for upload. They will be first aggregated during the given aggregation interval

type Config added in v1.3.0

type Config struct {
	PoolID             string
	NodeID             string
	InstrumentationKey string
	Processes          []string
	Aggregation        time.Duration
	SamplingRate       time.Duration
	Disable            DisableConfig
}

Config General config batch insights takes as input

func ValidateAndBuildConfig added in v1.3.0

func ValidateAndBuildConfig(userConfig UserConfig) (Config, error)

ValidateAndBuildConfig Convert Batch insights user config into config taken by the library

func (Config) Print added in v1.3.0

func (config Config) Print()

Print print the config to console

type DisableConfig added in v1.3.0

type DisableConfig struct {
	DiskIO    bool `json:"diskIO"`
	DiskUsage bool `json:"diskUsage"`
	NetworkIO bool `json:"networkIO"`
	GPU       bool `json:"gpu"`
	CPU       bool `json:"cpu"`
	Memory    bool `json:"memory"`
}

DisableConfig config showing which feature are disabled

func (DisableConfig) String added in v1.3.0

func (d DisableConfig) String() string

type GPUStatsCollector added in v1.1.0

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

GPUStatsCollector collector that retrieve gpu usage from nvml

func NewGPUStatsCollector added in v1.1.0

func NewGPUStatsCollector() GPUStatsCollector

NewGPUStatsCollector Create a new instance of the GPU stats collector

func (GPUStatsCollector) GetStats added in v1.1.0

func (gpu GPUStatsCollector) GetStats() []GPUUsage

GetStats Get GPU stats

func (GPUStatsCollector) Shutdown added in v1.1.0

func (gpu GPUStatsCollector) Shutdown()

Shutdown Dispose of the Nvidia driver connection

type GPUUsage added in v1.1.0

type GPUUsage struct {
	GPU    float64
	Memory float64
}

GPUUsage contains gpu stats

type NodeStats

type NodeStats struct {
	Memory      *mem.VirtualMemoryStat
	CPUPercents []float64
	DiskUsage   []*disk.UsageStat
	DiskIO      *utils.IOStats
	NetIO       *utils.IOStats
	Gpus        []GPUUsage
	Processes   []*ProcessPerfInfo
}

NodeStats Combined model for all metrics being collected at the given interal

type ProcessPerfInfo added in v1.2.0

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

ProcessPerfInfo Process specific information

func ListProcesses added in v1.2.0

func ListProcesses(processNames []string) ([]*ProcessPerfInfo, error)

ListProcesses Retrieve process cpu, memory, etc usage for the given list of process names

type UserConfig added in v1.3.0

type UserConfig struct {
	PoolID             *string
	NodeID             *string
	InstrumentationKey *string  // Application insights instrumentation key
	Processes          []string // List of process names to watch
	Aggregation        *int     // Local aggregation of data in minutes (default: 1)
	Disable            []string // List of metrics to disable
}

UserConfig config provided by the user either via command line, file or environemnt variable.

func (UserConfig) Merge added in v1.3.0

func (config UserConfig) Merge(other UserConfig) UserConfig

Merge with another config

func (UserConfig) Print added in v1.3.0

func (config UserConfig) Print()

Print print the config to console

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL