perf: add LB popularity vs cross-ref breakdown to slow path logging

This commit is contained in:
2026-03-29 16:04:31 -04:00
parent 261d506e65
commit 10d016f9d7
+10
View File
@@ -424,10 +424,20 @@ func (e *Service) Search(query string) (*MBSearchResult, error) {
e.boostWithIndexPopularity(&result)
} else {
// Phase 2: LB popularity lookups (3 POST calls, rate-limited).
lbStart := time.Now()
e.boostWithPopularity(&result)
lbDur := time.Since(lbStart)
// Phase 3: cross-reference artist discographies.
xrefStart := time.Now()
e.crossReferenceAlbums(query, &result)
xrefDur := time.Since(xrefStart)
e.logger.Info("search slow path breakdown",
"query", query,
"lbPopularity", lbDur.Round(time.Millisecond),
"crossRef", xrefDur.Round(time.Millisecond),
)
}
p2Dur := time.Since(p2Start)