mirror of
				https://github.com/ClusterCockpit/cc-backend
				synced 2025-10-31 07:55:06 +01:00 
			
		
		
		
	* Add option to also load Job Metric Data * Validate Job Metric Data * Allow null values in series array
		
			
				
	
	
		
			36 lines
		
	
	
		
			986 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			986 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright (C) 2022 NHR@FAU, University Erlangen-Nuremberg.
 | |
| // All rights reserved.
 | |
| // Use of this source code is governed by a MIT-style
 | |
| // license that can be found in the LICENSE file.
 | |
| package main
 | |
| 
 | |
| import (
 | |
| 	"encoding/json"
 | |
| 	"flag"
 | |
| 	"fmt"
 | |
| 	"log"
 | |
| 
 | |
| 	"github.com/ClusterCockpit/cc-backend/internal/config"
 | |
| 	"github.com/ClusterCockpit/cc-backend/pkg/archive"
 | |
| )
 | |
| 
 | |
| func main() {
 | |
| 	var srcPath, flagConfigFile string
 | |
| 
 | |
| 	flag.StringVar(&srcPath, "s", "./var/job-archive", "Specify the source job archive path. Default is ./var/job-archive")
 | |
| 	flag.StringVar(&flagConfigFile, "config", "./config.json", "Specify alternative path to `config.json`")
 | |
| 	flag.Parse()
 | |
| 	archiveCfg := fmt.Sprintf("{\"kind\": \"file\",\"path\": \"%s\"}", srcPath)
 | |
| 
 | |
| 	config.Init(flagConfigFile)
 | |
| 
 | |
| 	if err := archive.Init(json.RawMessage(archiveCfg)); err != nil {
 | |
| 		log.Fatal(err)
 | |
| 	}
 | |
| 	ar := archive.GetHandle()
 | |
| 
 | |
| 	for job := range ar.Iter(true) {
 | |
| 		log.Printf("Validate %s - %d\n", job.Meta.Cluster, job.Meta.JobID)
 | |
| 	}
 | |
| }
 |