This commit is contained in:
@@ -370,6 +370,16 @@ func filterSnapshotsWithRows(ctx context.Context, dbConn *sqlx.DB, snapshots []r
|
||||
return filtered
|
||||
}
|
||||
|
||||
func filterRecordsInRange(records []report.SnapshotRecord, start, end time.Time) []report.SnapshotRecord {
|
||||
filtered := records[:0]
|
||||
for _, r := range records {
|
||||
if !r.SnapshotTime.Before(start) && r.SnapshotTime.Before(end) {
|
||||
filtered = append(filtered, r)
|
||||
}
|
||||
}
|
||||
return filtered
|
||||
}
|
||||
|
||||
type columnDef struct {
|
||||
Name string
|
||||
Type string
|
||||
@@ -437,18 +447,17 @@ func normalizeResourcePool(value string) string {
|
||||
if trimmed == "" {
|
||||
return ""
|
||||
}
|
||||
switch {
|
||||
case strings.EqualFold(trimmed, "tin"):
|
||||
return "Tin"
|
||||
case strings.EqualFold(trimmed, "bronze"):
|
||||
return "Bronze"
|
||||
case strings.EqualFold(trimmed, "silver"):
|
||||
return "Silver"
|
||||
case strings.EqualFold(trimmed, "gold"):
|
||||
return "Gold"
|
||||
default:
|
||||
return trimmed
|
||||
lower := strings.ToLower(trimmed)
|
||||
canonical := map[string]string{
|
||||
"tin": "Tin",
|
||||
"bronze": "Bronze",
|
||||
"silver": "Silver",
|
||||
"gold": "Gold",
|
||||
}
|
||||
if val, ok := canonical[lower]; ok {
|
||||
return val
|
||||
}
|
||||
return trimmed
|
||||
}
|
||||
|
||||
func (c *CronTask) reportsDir() string {
|
||||
|
||||
Reference in New Issue
Block a user