monitoring

package
v0.2.24 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbPoller

type DbPoller struct {
	*task.Task
	// contains filtered or unexported fields
}

Periodically performs database queries and stores in the monitor state

func NewDbPoller

func NewDbPoller(config *config.Config) (self *DbPoller)

func (*DbPoller) WithDB

func (self *DbPoller) WithDB(db *gorm.DB) *DbPoller

func (*DbPoller) WithQuery

func (self *DbPoller) WithQuery(interval time.Duration, val *atomic.Int64, sql string) *DbPoller

type Monitor

type Monitor interface {
	IsOK() bool
	OnGetState(c *gin.Context)
	OnGetHealth(c *gin.Context)
	GetPrometheusCollector() (collector prometheus.Collector)
	GetReport() *report.Report
	SetPermanentError(err error)
	Clear()
}

Stores and computes monitor counters

type Query

type Query struct {
	Sql    string
	Atomic *atomic.Uint64
}

type Server

type Server struct {
	*task.Task

	Router *gin.Engine
	// contains filtered or unexported fields
}

Rest API server, serves monitor counters

func NewServer

func NewServer(config *config.Config) (self *Server)

func (*Server) WithMonitor

func (self *Server) WithMonitor(m Monitor) *Server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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