Adopt cc-lib hierarchical JobData/Statistics structs

cc-lib changed JobData, ScopedJobStats and Job.Statistics from flat maps
to structs (a .Metrics map plus array-valued Groups) to represent
filesystem (and future interconnect) metric groups. Migrate all
construction, indexing and iteration to the new API across the archive
backends, metricstore query path, metric dispatcher, archiver, importer,
tagger, taskmanager, repository and API layers.

Semantics: DecodeJobStats now projects JobData.Groups into
ScopedJobStats.Groups, and the archiver derives per-filesystem node-scope
statistics into Job.Statistics.Groups. deepCopy, resampling and the
metric/scope filter are group-aware. The metricstore internal storage
(buffers, selector tree, checkpoint/parquet) is unchanged; all conversion
stays at the LoadData/archive-codec seam.

Note: requires the corresponding cc-lib release; bump the cc-lib
dependency version once tagged (a local go.mod replace was used during
development and is intentionally not committed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-01 19:14:12 +02:00
co-authored by Claude Opus 4.8
parent 1bd3f25371
commit 0724b2dc60
25 changed files with 303 additions and 196 deletions
+6 -6
View File
@@ -299,7 +299,7 @@ func LoadAveragesFromArchive(
}
for i, m := range metrics {
if stat, ok := metaFile.Statistics[m]; ok {
if stat, ok := metaFile.Statistics.Metrics[m]; ok {
data[i] = append(data[i], schema.Float(stat.Avg))
} else {
data[i] = append(data[i], schema.NaN)
@@ -323,7 +323,7 @@ func LoadStatsFromArchive(
}
for _, m := range metrics {
stat, ok := metaFile.Statistics[m]
stat, ok := metaFile.Statistics.Metrics[m]
if !ok {
data[m] = schema.MetricStatistics{Min: 0.0, Avg: 0.0, Max: 0.0}
continue
@@ -349,19 +349,19 @@ func LoadScopedStatsFromArchive(
data, err := ar.LoadJobStats(job)
if err != nil {
cclog.Errorf("Error while loading job stats from archiveBackend: %s", err.Error())
return nil, err
return schema.ScopedJobStats{}, err
}
return data, nil
}
// GetStatistics returns all metric statistics for a job.
// Returns a map of metric names to their job-level statistics.
func GetStatistics(job *schema.Job) (map[string]schema.JobStatistics, error) {
// Returns the job-level statistics set.
func GetStatistics(job *schema.Job) (schema.JobStatisticsSet, error) {
metaFile, err := ar.LoadJobMeta(job)
if err != nil {
cclog.Errorf("Error while loading job metadata from archiveBackend: %s", err.Error())
return nil, err
return schema.JobStatisticsSet{}, err
}
return metaFile.Statistics, nil