feat(metrics): add scheduler related metrics (#2076)

Signed-off-by: Alexei Dodon <adodon@cisco.com>
This commit is contained in:
Alexei Dodon
2023-12-05 00:13:50 +02:00
committed by GitHub
parent 8bac653dd2
commit 2e733b3f4f
21 changed files with 566 additions and 69 deletions
+1 -1
View File
@@ -377,7 +377,7 @@ func (c *Controller) Shutdown() {
}
func (c *Controller) StartBackgroundTasks(reloadCtx context.Context) {
c.taskScheduler = scheduler.NewScheduler(c.Config, c.Log)
c.taskScheduler = scheduler.NewScheduler(c.Config, c.Metrics, c.Log)
c.taskScheduler.RunScheduler(reloadCtx)
// Enable running garbage-collect periodically for DefaultStore
+10
View File
@@ -3,6 +3,7 @@ package api
import (
"context"
"encoding/gob"
"fmt"
"io/fs"
"os"
"path"
@@ -157,3 +158,12 @@ func (cleanTask *CleanTask) DoWork(ctx context.Context) error {
return nil
}
func (cleanTask *CleanTask) String() string {
return fmt.Sprintf("{Name: %s, sessions: %s}",
cleanTask.Name(), cleanTask.sessions)
}
func (cleanTask *CleanTask) Name() string {
return "SessionCleanupTask"
}