mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
Change remaining audits to scan (#410)
This commit is contained in:
1 parent
6ca7a11d88
commit
fe69a17c9c
5 files changed
+15
-15
No files matched your search
+6
-6
@@ -63,8 +63,8 @@ type Leak struct {
|
||||
lookupHash string
|
||||
}
|
||||
|
||||
// AuditTime is a type used to determine total scan time
|
||||
type AuditTime int64
|
||||
// ScanTime is a type used to determine total scan time
|
||||
type ScanTime int64
|
||||
|
||||
// PatchTime is a type used to determine total patch time during an scan
|
||||
type PatchTime int64
|
||||
@@ -89,7 +89,7 @@ type Metadata struct {
|
||||
|
||||
RegexTime map[string]int64
|
||||
Commits int
|
||||
AuditTime int64
|
||||
ScanTime int64
|
||||
patchTime int64
|
||||
cloneTime int64
|
||||
}
|
||||
@@ -214,8 +214,8 @@ func (manager *Manager) receiveMetadata() {
|
||||
switch ti := t.(type) {
|
||||
case CloneTime:
|
||||
manager.metadata.cloneTime += int64(ti)
|
||||
case AuditTime:
|
||||
manager.metadata.AuditTime += int64(ti)
|
||||
case ScanTime:
|
||||
manager.metadata.ScanTime += int64(ti)
|
||||
case PatchTime:
|
||||
manager.metadata.patchTime += int64(ti)
|
||||
case RegexTime:
|
||||
@@ -243,7 +243,7 @@ func (manager *Manager) DebugOutput() {
|
||||
log.Debugf("-------------------------\n")
|
||||
log.Debugf("| Times and Commit Counts|\n")
|
||||
log.Debugf("-------------------------\n")
|
||||
fmt.Println("totalAuditTime: ", durafmt.Parse(time.Duration(manager.metadata.AuditTime)*time.Nanosecond))
|
||||
fmt.Println("totalScanTime: ", durafmt.Parse(time.Duration(manager.metadata.ScanTime)*time.Nanosecond))
|
||||
fmt.Println("totalPatchTime: ", durafmt.Parse(time.Duration(manager.metadata.patchTime)*time.Nanosecond))
|
||||
fmt.Println("totalCloneTime: ", durafmt.Parse(time.Duration(manager.metadata.cloneTime)*time.Nanosecond))
|
||||
fmt.Println("totalCommits: ", manager.metadata.Commits)
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestSendReceiveMeta(t *testing.T) {
|
||||
m, _ := NewManager(opts, cfg)
|
||||
|
||||
for i := 0; i < test.iterations; i++ {
|
||||
m.RecordTime(AuditTime(test.scanTime))
|
||||
m.RecordTime(ScanTime(test.scanTime))
|
||||
m.RecordTime(PatchTime(test.patchTime))
|
||||
m.RecordTime(CloneTime(test.cloneTime))
|
||||
m.RecordTime(RegexTime{
|
||||
@@ -82,9 +82,9 @@ func TestSendReceiveMeta(t *testing.T) {
|
||||
t.Errorf("clone time mismatch, got %d, wanted %d",
|
||||
md.cloneTime, test.cloneTime*int64(test.iterations))
|
||||
}
|
||||
if md.AuditTime != test.scanTime*int64(test.iterations) {
|
||||
if md.ScanTime != test.scanTime*int64(test.iterations) {
|
||||
t.Errorf("scan time mismatch, got %d, wanted %d",
|
||||
md.AuditTime, test.scanTime*int64(test.iterations))
|
||||
md.ScanTime, test.scanTime*int64(test.iterations))
|
||||
}
|
||||
if md.patchTime != test.patchTime*int64(test.iterations) {
|
||||
t.Errorf("clone time mismatch, got %d, wanted %d",
|
||||
|
||||
Reference in new issue
Block a user