detector

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RECORDTYPE_LOSTCONNECTION = "lost_connection"
	RECORDTYPE_CRITICAL       = "critical"
	RECORDTYPE_DEBUG          = "debug"
	RECORDTYPE_OTHER          = "other"
	RECORDTYPE_SUSPECT_CRASH  = "suspect_crash"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

type Detector struct {
	Lck      sync.RWMutex
	Services map[string]ServiceRecorder

	logger.UnimplementedLoggerServer
}

func (*Detector) AddRecord added in v1.8.1

func (dtc *Detector) AddRecord(record RecordDetail, serviceGroup string)

func (*Detector) ClearIncidentReport added in v1.8.1

func (dtc *Detector) ClearIncidentReport() error

func (*Detector) GetIncidentCountAll added in v1.8.1

func (dtc *Detector) GetIncidentCountAll() (map[string]map[string]int, int)

func (*Detector) GetIncidentCountByService added in v1.8.1

func (dtc *Detector) GetIncidentCountByService(ServiceGroup string) map[string]int

func (*Detector) GetIncidentReportByService added in v1.8.1

func (dtc *Detector) GetIncidentReportByService(ServiceGroup string) map[string][]RecordDetail

func (*Detector) GetIncidentReportByServiceAndType added in v1.8.1

func (dtc *Detector) GetIncidentReportByServiceAndType(ServiceGroup string, recordType string) []RecordDetail

func (*Detector) RecordLog

func (dtc *Detector) RecordLog(ctx context.Context, in *logger.LogRequest) (*emptypb.Empty, error)

func (*Detector) StartService

func (dtc *Detector) StartService(port int)

type RecordDetail added in v1.8.1

type RecordDetail struct {
	ServiceID string
	Type      string
	Reason    string
	Time      int64
}

type ServiceRecorder added in v1.8.1

type ServiceRecorder struct {
	Records map[string][]RecordDetail // map[RECORD_TYPE][]RecordDetail
}

Jump to

Keyboard shortcuts

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