From 67d35480a4fdc7c65fa486ea5316467a2fca7b6b Mon Sep 17 00:00:00 2001 From: John Barker Date: Thu, 19 Dec 2019 19:08:07 -0700 Subject: [PATCH] Remove statisticsLogger from runQueue, prometheus does this now --- core/services/run_queue.go | 25 ------------------------- go.mod | 1 - 2 files changed, 26 deletions(-) diff --git a/core/services/run_queue.go b/core/services/run_queue.go index 63b6f182c48..cacd1fcf938 100644 --- a/core/services/run_queue.go +++ b/core/services/run_queue.go @@ -3,7 +3,6 @@ package services import ( "fmt" "sync" - "time" "chainlink/core/logger" "chainlink/core/store/models" @@ -40,16 +39,11 @@ type runQueue struct { workersWg sync.WaitGroup runExecutor RunExecutor - - runsQueued uint - runsExecuted uint - quit chan struct{} } // NewRunQueue initializes a RunQueue. func NewRunQueue(runExecutor RunExecutor) RunQueue { return &runQueue{ - quit: make(chan struct{}), workers: make(map[string]int), runExecutor: runExecutor, } @@ -57,28 +51,11 @@ func NewRunQueue(runExecutor RunExecutor) RunQueue { // Start prepares the job runner for accepting runs to execute. func (rq *runQueue) Start() error { - go rq.statisticsLogger() return nil } -func (rq *runQueue) statisticsLogger() { - ticker := time.NewTicker(5 * time.Minute) - for { - select { - case <-ticker.C: - rq.workersMutex.RLock() - logger.Debugw("Run queue statistics", "runs_executed", rq.runsExecuted, "runs_queued", rq.runsQueued, "worker_count", len(rq.workers)) - rq.workersMutex.RUnlock() - case <-rq.quit: - ticker.Stop() - return - } - } -} - // Stop closes all open worker channels. func (rq *runQueue) Stop() { - rq.quit <- struct{}{} rq.workersWg.Wait() } @@ -90,12 +67,10 @@ func (rq *runQueue) Run(run *models.JobRun) { rq.workersMutex.Lock() if queueCount, present := rq.workers[runID]; present { - rq.runsQueued += 1 rq.workers[runID] = queueCount + 1 rq.workersMutex.Unlock() return } - rq.runsExecuted += 1 rq.workers[runID] = 1 numberRunQueueWorkers.Set(float64(len(rq.workers))) rq.workersMutex.Unlock() diff --git a/go.mod b/go.mod index c6259ccf289..31488b6a893 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,6 @@ require ( github.com/prometheus/client_golang v1.2.1 github.com/prometheus/client_model v0.0.0-20191202183732-d1d2010b5bee // indirect github.com/prometheus/procfs v0.0.8 // indirect - github.com/prometheus/tsdb v0.7.1 // indirect github.com/rjeczalik/notify v0.9.2 // indirect github.com/rs/cors v1.6.0 // indirect github.com/satori/go.uuid v1.2.0