metrics

package
v4.3.1008+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKeycodeExpirationSpecs         = "0 0 * * * *"
	DefaultKeycodeExpirationEventInterval = "90,60,30,15,7,6,5,4,3,2,1,0,-1,-2,-3,-4,-5,-6,-7"
	DefaultKeycodeExpirationEventLevel    = "90:Info,15:Warn,0:Error"
)
View Source
const (
	DefaultLicenseCapacityCPUSpecs         = "0 0 * * * *"
	DefaultLicenseCapacityCPUEventInterval = "14,13,12,11,10,9,8,7,6,5,4,3,2,1,0"
	DefaultLicenseCapacityCPUEventLevel    = "14:Warn,0:Error"
)
View Source
const (
	CPUCoresGracePeriod = "Number of CPU cores exceed the licensed number of CPU cores, grace period will expire on %s"
	CPUCoresExceed      = "Number of CPU cores exceed the licensed number of CPU cores"
)
View Source
const (
	DefaultMeteringFederatoraiEnabled = true
	DefaultMeteringFederatoraiSpecs   = "0 0 0 * * *"
)

Variables

View Source
var (
	KeycodeMgt *keycodes.KeycodeMgt
	SchemaMgt  *schemamgt.SchemaManagement
)

Functions

func Init

func Init(influxCfg *influxdb.Config)

Types

type AlertInterface

type AlertInterface interface {
	GetName() string
	GetType() string
	GetCategory() string
	GetSpecs() string
	GetEnabled() bool
	MeetCriteria() bool
	Validate()
	GenerateCriteria()
	ClearEventPosted()
}

func NewKeycodeMetrics

func NewKeycodeMetrics(keycodeCfg *KeycodeConfig, influxCfg *influxdb.Config) []AlertInterface

func NewLicenseCapacity

func NewLicenseCapacity(capacityCfg *LicenseCapacityConfig, influxCfg *influxdb.Config) []AlertInterface

func NewLicenseMetrics

func NewLicenseMetrics(licenseCfg *LicenseConfig, influxCfg *influxdb.Config) []AlertInterface

func NewMeteringMetrics

func NewMeteringMetrics(meteringCfg *MeteringConfig, influxCfg *influxdb.Config) []AlertInterface

type AlertMetrics

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

func (*AlertMetrics) ClearEventPosted

func (c *AlertMetrics) ClearEventPosted()

func (*AlertMetrics) GenerateCriteria

func (c *AlertMetrics) GenerateCriteria()

func (*AlertMetrics) GetCategory

func (c *AlertMetrics) GetCategory() string

func (*AlertMetrics) GetEnabled

func (c *AlertMetrics) GetEnabled() bool

func (*AlertMetrics) GetName

func (c *AlertMetrics) GetName() string

func (*AlertMetrics) GetSpecs

func (c *AlertMetrics) GetSpecs() string

func (*AlertMetrics) GetType

func (c *AlertMetrics) GetType() string

func (*AlertMetrics) MeetCriteria

func (c *AlertMetrics) MeetCriteria() bool

func (*AlertMetrics) Validate

func (c *AlertMetrics) Validate()

type CriteriaType

type CriteriaType int
const (
	CriteriaTypeUndefined  CriteriaType = 0
	CriteriaTypeGauge      CriteriaType = 1
	CriteriaTypeContinuous CriteriaType = 2
)

type KeycodeConfig

type KeycodeConfig struct {
	Enabled    bool      `mapstructure:"enabled"`
	Expiration *Notifier `mapstructure:"expiration"`
}

func NewDefaultKeycodeConfig

func NewDefaultKeycodeConfig() *KeycodeConfig

type KeycodeExpiration

type KeycodeExpiration struct {
	AlertMetrics
	// contains filtered or unexported fields
}

func NewKeycodeExpiration

func NewKeycodeExpiration(notifier *Notifier, influxCfg *influxdb.Config) *KeycodeExpiration

func (*KeycodeExpiration) MeetCriteria

func (c *KeycodeExpiration) MeetCriteria() bool

func (*KeycodeExpiration) PostEvent

func (c *KeycodeExpiration) PostEvent() error

func (*KeycodeExpiration) Validate

func (c *KeycodeExpiration) Validate()

type LicenseCapacityCPU

type LicenseCapacityCPU struct {
	AlertMetrics
	// contains filtered or unexported fields
}

func NewLicenseCapacityCPU

func NewLicenseCapacityCPU(notifier *Notifier, influxCfg *influxdb.Config) *LicenseCapacityCPU

func (*LicenseCapacityCPU) MeetCriteria

func (c *LicenseCapacityCPU) MeetCriteria() bool

func (*LicenseCapacityCPU) PostEvent

func (c *LicenseCapacityCPU) PostEvent() error

func (*LicenseCapacityCPU) Validate

func (c *LicenseCapacityCPU) Validate()

type LicenseCapacityConfig

type LicenseCapacityConfig struct {
	Enabled bool      `mapstructure:"enabled"`
	CPU     *Notifier `mapstructure:"cpu"`
}

type LicenseConfig

type LicenseConfig struct {
	Enabled  bool                   `mapstructure:"enabled"`
	Capacity *LicenseCapacityConfig `mapstructure:"capacity"`
}

func NewDefaultLicenseConfig

func NewDefaultLicenseConfig() *LicenseConfig

type MeteringConfig

type MeteringConfig struct {
	Enabled     bool      `mapstructure:"enabled"`
	Federatorai *Notifier `mapstructure:"federatorai"`
}

func NewDefaultMeteringConfig

func NewDefaultMeteringConfig() *MeteringConfig

type MeteringFederatorai

type MeteringFederatorai struct {
	AlertMetrics
	// contains filtered or unexported fields
}

func NewMeteringFederatorai

func NewMeteringFederatorai(notifier *Notifier, influxCfg *influxdb.Config) *MeteringFederatorai

func (*MeteringFederatorai) Validate

func (c *MeteringFederatorai) Validate()

type Notifier

type Notifier struct {
	Enabled       bool   `mapstructure:"enabled"`
	Specs         string `mapstructure:"specs"`
	EventInterval string `mapstructure:"eventInterval"`
	EventLevel    string `mapstructure:"eventLevel"`
}

Jump to

Keyboard shortcuts

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