Skip to content

Commit

Permalink
More logging
Browse files Browse the repository at this point in the history
  • Loading branch information
lalinsky committed Feb 13, 2024
1 parent 80757b2 commit 1ea54b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/fpstore/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package fpstore
import (
"context"
"fmt"
"time"

"net"

Expand Down Expand Up @@ -159,12 +160,19 @@ func (s *FingerprintStoreService) Search(ctx context.Context, req *pb.SearchFing
return nil, status.Error(codes.Internal, "failed to search index")
}

log.Debug().Int("candidates", len(candidateIds)).Msg("received candidates")

startTime := time.Now()

results, err := s.compareFingerprints(ctx, req.Fingerprint, candidateIds)
if err != nil {
return nil, err
}
if len(results) > maxResults {
results = results[:maxResults]
}

log.Debug().Dur("duration", time.Since(startTime)).Int("results", len(results)).Msg("search finished")

return &pb.SearchFingerprintResponse{Results: results}, nil
}

0 comments on commit 1ea54b5

Please sign in to comment.