Documentation
¶
Index ¶
- Variables
- func GetCurrentDbConnErr() (string, int64)
- func NewGoMetrics() *goMetrics
- func StartHeartbeat(ctx context.Context, client *redis.Client, logger *logging.Logger, ha ha, ...) *atomic.Pointer[SuccessfulSync]
- func UpdateCurrentDbConnErr(err error)
- func WriteStats(ctx context.Context, client *redis.Client, logger *logging.Logger)
- type SuccessfulSync
Constants ¶
This section is empty.
Variables ¶
var OngoingSyncStartMilli atomic.Int64
OngoingSyncStartMilli is to be updated by the main() function.
Functions ¶
func GetCurrentDbConnErr ¶
GetCurrentDbConnErr returns the last error message (or the empty string if not in an error state) and a timestamp in milliseconds of the last change from OK to error or from error to OK.
func NewGoMetrics ¶
func NewGoMetrics() *goMetrics
func StartHeartbeat ¶
func StartHeartbeat( ctx context.Context, client *redis.Client, logger *logging.Logger, ha ha, heartbeat *icingaredis.Heartbeat, ) *atomic.Pointer[SuccessfulSync]
StartHeartbeat periodically writes heartbeats to Redis for being monitored by Icinga 2. It returns an atomic pointer to SuccessfulSync, which contains synchronisation statistics that the caller should update.
func UpdateCurrentDbConnErr ¶
func UpdateCurrentDbConnErr(err error)
UpdateCurrentDbConnErr updates the current error information stored in currentDbConnErr.