refactor code and improve daily cache handling of deleted VMs
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -307,40 +307,6 @@ func (c *CronTask) aggregateDailySummaryGo(ctx context.Context, dayStart, dayEnd
|
||||
return nil
|
||||
}
|
||||
|
||||
type dailyAggKey struct {
|
||||
Vcenter string
|
||||
VmId string
|
||||
VmUuid string
|
||||
Name string
|
||||
}
|
||||
|
||||
type dailyAggVal struct {
|
||||
key dailyAggKey
|
||||
resourcePool string
|
||||
datacenter string
|
||||
cluster string
|
||||
folder string
|
||||
isTemplate string
|
||||
poweredOn string
|
||||
srmPlaceholder string
|
||||
creation int64
|
||||
firstSeen int64
|
||||
lastSeen int64
|
||||
lastDisk float64
|
||||
lastVcpu int64
|
||||
lastRam int64
|
||||
sumVcpu int64
|
||||
sumRam int64
|
||||
sumDisk float64
|
||||
samples int64
|
||||
tinHits int64
|
||||
bronzeHits int64
|
||||
silverHits int64
|
||||
goldHits int64
|
||||
seen map[int64]struct{}
|
||||
deletion int64
|
||||
}
|
||||
|
||||
func (c *CronTask) scanHourlyTablesParallel(ctx context.Context, snapshots []report.SnapshotRecord) (map[dailyAggKey]*dailyAggVal, error) {
|
||||
agg := make(map[dailyAggKey]*dailyAggVal, 1024)
|
||||
mu := sync.Mutex{}
|
||||
|
||||
Reference in New Issue
Block a user