From aad7e793da824395ae8404c3ed32936f1690e5e5 Mon Sep 17 00:00:00 2001 From: Keegan Carruthers-Smith Date: Mon, 9 Dec 2024 16:18:54 +0200 Subject: [PATCH] shards: trace printf on one line for List If we have lots of work done we start to truncate in net/trace. So display information more succinctly. Test Plan: CI doesn't complain should be good enough --- shards/eval.go | 5 +---- shards/shards.go | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/shards/eval.go b/shards/eval.go index da455951..debe6d2a 100644 --- a/shards/eval.go +++ b/shards/eval.go @@ -80,10 +80,7 @@ func (s *typeRepoSearcher) List(ctx context.Context, q query.Q, opts *zoekt.List } defer func() { if rl != nil { - tr.LazyPrintf("repos size: %d", len(rl.Repos)) - tr.LazyPrintf("reposmap size: %d", len(rl.ReposMap)) - tr.LazyPrintf("crashes: %d", rl.Crashes) - tr.LazyPrintf("stats: %+v", rl.Stats) + tr.LazyPrintf("repos.size=%d reposmap.size=%d crashes=%d stats=%+v", len(rl.Repos), len(rl.ReposMap), rl.Crashes, rl.Stats) } if err != nil { tr.LazyPrintf("error: %v", err) diff --git a/shards/shards.go b/shards/shards.go index 4dcf0a62..6f13d5ae 100644 --- a/shards/shards.go +++ b/shards/shards.go @@ -935,7 +935,7 @@ func (ss *shardedSearcher) List(ctx context.Context, q query.Q, opts *zoekt.List defer func() { metricListRunning.Dec() if rl != nil { - tr.LazyPrintf("repos.size=%d reposmap.size=%d crashes=%d", len(rl.Repos), len(rl.ReposMap), rl.Crashes) + tr.LazyPrintf("repos.size=%d reposmap.size=%d crashes=%d stats=%+v", len(rl.Repos), len(rl.ReposMap), rl.Crashes, rl.Stats) } if err != nil { tr.LazyPrintf("error: %v", err)