rand

package
v0.0.0-...-c764e65 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RandCollector

type RandCollector struct {
}

Mock collector implementation used for testing

func (RandCollector) CollectMetrics

func (RandCollector) CollectMetrics(mts []plugin.Metric) ([]plugin.Metric, error)
CollectMetrics collects metrics for testing.

CollectMetrics() will be called by Snap when a task that collects one of the metrics returned from this plugins GetMetricTypes() is started. The input will include a slice of all the metric types being collected.

The output is the collected metrics as plugin.Metric and an error.

func (RandCollector) GetConfigPolicy

func (RandCollector) GetConfigPolicy() (plugin.ConfigPolicy, error)

GetConfigPolicy() returns the configPolicy for your plugin.

A config policy is how users can provide configuration info to plugin. Here you define what sorts of config info your plugin needs and/or requires.

func (RandCollector) GetMetricTypes

func (RandCollector) GetMetricTypes(cfg plugin.Config) ([]plugin.Metric, error)

GetMetricTypes returns metric types for testing. GetMetricTypes() will be called when your plugin is loaded in order to populate the metric catalog(where snaps stores all available metrics).

Config info is passed in. This config information would come from global config snap settings.

The metrics returned will be advertised to users who list all the metrics and will become targetable by tasks.

Jump to

Keyboard shortcuts

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