fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

Remove index queue age metric (#810)

The new metric `index_indexing_delay_seconds` is looking good on dot com and
producing more interpretable results. This PR removes the old metric
`index_queue_age_seconds`. And it increases the bucket range for the new
metric, since we sometimes exceed the current 2 day limit.

+4 -44
+4 -19
cmd/zoekt-sourcegraph-indexserver/main.go
··· 90 90 }) 91 91 92 92 metricIndexingDelay = promauto.NewHistogramVec(prometheus.HistogramOpts{ 93 - Name: "index_indexing_delay_seconds", 94 - Help: "A histogram of durations from when an index job is added to the queue, to the time it completes.", 95 - Buckets: []float64{ 96 - 60, // 1m 97 - 300, // 5m 98 - 1200, // 20m 99 - 2400, // 40m 100 - 3600, // 1h 101 - 10800, // 3h 102 - 18000, // 5h 103 - 36000, // 10h 104 - 43200, // 12h 105 - 54000, // 15h 106 - 72000, // 20h 107 - 86400, // 24h 108 - 108000, // 30h 109 - 126000, // 35h 110 - 172800, // 48h 111 - }}, []string{ 93 + Name: "index_indexing_delay_seconds", 94 + Help: "A histogram of durations from when an index job is added to the queue, to the time it completes.", 95 + Buckets: prometheus.ExponentialBuckets(60, 2, 12), // 1m -> ~3 days 96 + }, []string{ 112 97 "state", // state is an indexState 113 98 "name", // the name of the repository that was indexed 114 99 })
-25
cmd/zoekt-sourcegraph-indexserver/queue.go
··· 107 107 108 108 q.mu.Unlock() 109 109 110 - name := repoNameForMetric(item.opts.Name) 111 - age := time.Since(dateAdded) 112 - metricQueueAge.WithLabelValues(name).Observe(age.Seconds()) 113 - 114 110 return QueueItem{item.opts, dateAdded}, true 115 111 } 116 112 ··· 436 432 Name: "index_queue_cap", 437 433 Help: "The number of repositories tracked by the index queue, including popped items. Should be the same as index_num_assigned.", 438 434 }) 439 - metricQueueAge = promauto.NewHistogramVec(prometheus.HistogramOpts{ 440 - Name: "index_queue_age_seconds", 441 - Help: "A histogram of the amount of time a popped repository spent sitting in the queue beforehand.", 442 - Buckets: []float64{ 443 - 60, // 1m 444 - 300, // 5m 445 - 1200, // 20m 446 - 2400, // 40m 447 - 3600, // 1h 448 - 10800, // 3h 449 - 18000, // 5h 450 - 36000, // 10h 451 - 43200, // 12h 452 - 54000, // 15h 453 - 72000, // 20h 454 - 86400, // 24h 455 - 108000, // 30h 456 - 126000, // 35h 457 - 172800, // 48h 458 - }, 459 - }, []string{"name"}) // name=name of the repository that was just popped from the queue 460 435 )