sysvars

package
v0.0.0-...-eff70b3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package sysvars implements a system variables exporter. It exports variables defined through an environment variable, as well other system variables like process uptime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ll *logger.Logger, userVars map[string]string) error

Init initializes the sysvars module's global data structure. Init makes sure to initialize only once, further calls are a no-op. If needed, userVars can be passed to Init to add custom variables to sysVars. This can be useful for tests which require sysvars that might not exist, or might have the wrong value.

func Start

func Start(ctx context.Context, dataChan chan *metrics.EventMetrics, interval time.Duration, envVarsName string)

Start exports system variables at the given interval. It overlays variables with variables passed through the envVarsName env variable.

func Vars

func Vars() map[string]string

Vars returns a copy of the system variables map, if already initialized. Otherwise an empty map is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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