mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
[chore] - log enumeration duration (#1187)
* log enumeration duration. * use defer to print enumeration duration stat. * remove temp var.
This commit is contained in:
parent
62d44f59f5
commit
ffbd9c1ead
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue