Skip to content

Commit

Permalink
shards: trace printf on one line for List
Browse files Browse the repository at this point in the history
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
  • Loading branch information
keegancsmith committed Dec 9, 2024
1 parent 5cad1d8 commit aad7e79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions shards/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion shards/shards.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aad7e79

Please sign in to comment.