Skip to content

Find, verify, and analyze leaked credentials

[chore] - log enumeration duration (#1187)

ahravffbd9c1ead17
diff --git a/pkg/sources/gcs/gcs_manager.go b/pkg/sources/gcs/gcs_manager.go
index 3fb58a8e0..4758e2e34 100644
--- a/pkg/sources/gcs/gcs_manager.go
+++ b/pkg/sources/gcs/gcs_manager.go
@@ -383,6 +383,10 @@ func (g *gcsManager) enumerate(ctx context.Context, bkts []bucket) (*attributes,
logger.V(5).Info("enumerating buckets", "numBuckets", len(bkts))
stats := newStats(len(bkts))
+ defer func(start time.Time) {
+ logger.V(5).Info("finished enumerating buckets", "duration-seconds", fmt.Sprintf("%.1f", time.Since(start).Seconds()), "num-buckets", len(bkts), "num-objects", stats.numObjects)
+ }(time.Now())
+
for _, bkt := range bkts {
bkt := bkt
g.workerPool.Go(func() error {
@@ -426,7 +430,6 @@ func (g *gcsManager) enumerate(ctx context.Context, bkts []bucket) (*attributes,
_ = g.workerPool.Wait()
g.attr = stats
- logger.V(5).Info("finished enumerating buckets", "num-objects", stats.numObjects, "num-buckets", stats.numBuckets)
return stats, nil
}