application

package
v4.0.0-rc11 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Splits counter type
	Splits = iota
	// Segments counter type
	Segments
	// Storage counter type
	Storage
	// SyncErros counter type
	SyncErros
)
View Source
const (
	// Critical severity
	Critical = iota
	// Low severity
	Low
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name                     string
	CounterType              int
	Periodic                 bool
	TaskFunc                 func(l logging.LoggerInterface, c CounterInterface) error
	Period                   int
	MaxErrorsAllowedInPeriod int
	Severity                 int
}

Config counter configuration

type CounterInterface

type CounterInterface interface {
	IsHealthy() HealthyResult
	NotifyEvent()
	Reset(value int) error
	GetType() int
	UpdateLastHit()
	Start()
	Stop()
}

CounterInterface application counter interface

type HealthDto

type HealthDto struct {
	Healthy      bool      `json:"healthy"`
	HealthySince *int64    `json:"healthySince"`
	Items        []ItemDto `json:"items"`
}

HealthDto struct

type HealthyResult

type HealthyResult struct {
	Name       string
	Severity   int
	Healthy    bool
	LastHit    *int64
	ErrorCount int
}

HealthyResult description

type ItemDto

type ItemDto struct {
	Name       string `json:"name"`
	Healthy    bool   `json:"healthy"`
	LastHit    *int64 `json:"lastHit,omitempty"`
	ErrorCount int    `json:"errorCount,omitempty"`
	Severity   int    `json:"-"`
}

ItemDto struct

type MonitorInterface

type MonitorInterface interface {
	Start()
	Stop()
	GetHealthStatus() HealthDto
	NotifyEvent(counterType int)
	Reset(counterType int, value int)
}

MonitorInterface application monitor interface

Jump to

Keyboard shortcuts

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