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

Configure Feed

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

all: observe missing Stats RegexpsConsidered and FlushReason (#611)

Noticed we didn't include these fields in our prometheus and logging
integration.

Test Plan: go test ./...

+7
+2
cmd/zoekt-webserver/main.go
··· 596 596 sglog.Int("stat.NgramMatches", st.NgramMatches), 597 597 sglog.Int("stat.NgramLookups", st.NgramLookups), 598 598 sglog.Duration("stat.Wait", st.Wait), 599 + sglog.Int("stat.RegexpsConsidered", st.RegexpsConsidered), 600 + sglog.String("stat.FlushReason", st.FlushReason.String()), 599 601 ) 600 602 } 601 603
+5
shards/shards.go
··· 119 119 Name: "zoekt_search_ngram_lookups_total", 120 120 Help: "Total number of times we accessed an ngram in the index", 121 121 }) 122 + metricSearchRegexpsConsideredTotal = promauto.NewCounter(prometheus.CounterOpts{ 123 + Name: "zoekt_search_regexps_considered_total", 124 + Help: "Total number of times regexp was called on files that we evaluated", 125 + }) 122 126 123 127 metricListRunning = promauto.NewGauge(prometheus.GaugeOpts{ 124 128 Name: "zoekt_list_running", ··· 826 830 metricSearchMatchCountTotal.Add(float64(sr.Stats.MatchCount)) 827 831 metricSearchNgramMatchesTotal.Add(float64(sr.Stats.NgramMatches)) 828 832 metricSearchNgramLookupsTotal.Add(float64(sr.Stats.NgramLookups)) 833 + metricSearchRegexpsConsideredTotal.Add(float64(sr.Stats.RegexpsConsidered)) 829 834 } 830 835 831 836 func copySlice(src *[]byte) {