Documentation ¶
Index ¶
- Constants
- Variables
- func Register(name string, creator Creator)
- type Base
- type Chart
- func (c *Chart) AddDim(newDim *Dim) error
- func (c *Chart) AddVar(newVar *Var) error
- func (c Chart) Copy() *Chart
- func (c *Chart) GetDim(dimID string) *Dim
- func (c Chart) HasDim(dimID string) bool
- func (c *Chart) MarkDimRemove(dimID string, hide bool) error
- func (c *Chart) MarkNotCreated()
- func (c *Chart) MarkRemove()
- func (c *Chart) RemoveDim(dimID string) error
- type ChartType
- type Charts
- type Creator
- type Defaults
- type Dim
- type DimOpts
- type Dims
- type Job
- func (j *Job) AutoDetection() (ok bool)
- func (j Job) AutoDetectionEvery() int
- func (j Job) FullName() string
- func (j Job) ModuleName() string
- func (j Job) Name() string
- func (j Job) Panicked() bool
- func (j Job) RetryAutoDetection() bool
- func (j *Job) Start()
- func (j *Job) Stop()
- func (j *Job) Tick(clock int)
- type JobConfig
- type MockModule
- type Module
- type Opts
- type Registry
- type Var
- type Vars
Constants ¶
const ( // Line chart type. Line ChartType = "line" // Area chart type. Area ChartType = "area" // Stacked chart type. Stacked ChartType = "stacked" // Absolute dimension algorithm. // The value is to drawn as-is (interpolated to second boundary). Absolute dimAlgo = "absolute" // Incremental dimension algorithm. // The value increases over time, the difference from the last value is presented in the chart, // the server interpolates the value and calculates a per second figure. Incremental dimAlgo = "incremental" // PercentOfAbsolute dimension algorithm. // The percent of this value compared to the total of all dimensions. PercentOfAbsolute dimAlgo = "percentage-of-absolute-row" // PercentOfIncremental dimension algorithm. // The percent of this value compared to the incremental total of all dimensions PercentOfIncremental dimAlgo = "percentage-of-incremental-row" )
const ( UpdateEvery = 1 AutoDetectionRetry = 0 Priority = 70000 )
const RRD_ID_LENGTH_MAX = 200
https://github.com/netdata/netdata/blob/ab0ffcebf802803d1e88f6a5e47a314c292b45e3/database/rrd.h#L59 Chart type.id (job.FullName() + '.' + chart.ID)
Variables ¶
var DefaultRegistry = Registry{}
DefaultRegistry DefaultRegistry.
Functions ¶
Types ¶
type Chart ¶
type Chart struct { ID string OverID string Title string Units string Fam string Ctx string Type ChartType Priority int Opts Dims Dims Vars Vars Retries int // contains filtered or unexported fields }
Chart represents a chart. For the full description please visit https://docs.netdata.cloud/collectors/plugins.d/#chart
func (Chart) HasDim ¶
HasDim returns true if the chart contains dimension with the given ID, false otherwise.
func (*Chart) MarkDimRemove ¶
MarkDimRemove sets 'remove' flag, Obsolete and optionally Hidden options to true. Use it to remove dimension in runtime.
func (*Chart) MarkNotCreated ¶
func (c *Chart) MarkNotCreated()
MarkNotCreated changes 'created' chart flag to false. Use it to add dimension in runtime.
func (*Chart) MarkRemove ¶
func (c *Chart) MarkRemove()
MarkRemove sets 'remove' flag and Obsolete option to true. Use it to remove chart in runtime.
type Charts ¶
type Charts []*Chart
Charts is a collection of Charts.
type Dim ¶
type Dim struct { ID string Name string Algo dimAlgo Mul int Div int DimOpts // contains filtered or unexported fields }
Dim represents a chart dimension. For detailed description please visit https://docs.netdata.cloud/collectors/plugins.d/#dimension.
type Job ¶
type Job struct { AutoDetectEvery int AutoDetectTries int *logger.Logger // contains filtered or unexported fields }
Job represents a job. It's a module wrapper.
func (*Job) AutoDetection ¶
AutoDetection invokes init, check and postCheck. It handles panic.
func (Job) AutoDetectionEvery ¶
AutoDetectionEvery returns value of AutoDetectEvery.
func (Job) RetryAutoDetection ¶
RetryAutoDetection returns whether it is needed to retry autodetection.
type MockModule ¶
type MockModule struct { Base InitFunc func() bool CheckFunc func() bool ChartsFunc func() *Charts CollectFunc func() map[string]int64 CleanupFunc func() CleanupDone bool }
MockModule MockModule.
func (MockModule) Collect ¶
func (m MockModule) Collect() map[string]int64
Collect invokes CollectDunc.
type Module ¶
type Module interface { // Init does initialization. // If it return false, the job will be disabled. Init() bool // Check is called after Init. // If it return false, the job will be disabled. Check() bool // Charts returns the chart definition. // Make sure not to share returned instance. Charts() *Charts // Collect collects metrics. Collect() map[string]int64 // Cleanup Cleanup Cleanup() GetBase() *Base }
Module is an interface that represents a module.
type Var ¶
Var represents a chart variable. For detailed description please visit https://docs.netdata.cloud/collectors/plugins.d/#variable