mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 12:51:40 +02:00
BC: new schemas for basically everything
This commit is contained in:
@@ -9,10 +9,10 @@ import (
|
||||
type JobData map[string]*JobMetric
|
||||
|
||||
type JobMetric struct {
|
||||
Unit string `json:"unit"`
|
||||
Scope MetricScope `json:"scope"`
|
||||
Timestep int `json:"timestep"`
|
||||
Series []*MetricSeries `json:"series"`
|
||||
Unit string `json:"Unit"`
|
||||
Scope MetricScope `json:"Scope"`
|
||||
Timestep int `json:"Timestep"`
|
||||
Series []*MetricSeries `json:"Series"`
|
||||
}
|
||||
|
||||
type MetricScope string
|
||||
@@ -41,38 +41,59 @@ func (e MetricScope) MarshalGQL(w io.Writer) {
|
||||
}
|
||||
|
||||
type MetricStatistics struct {
|
||||
Avg float64 `json:"avg"`
|
||||
Min float64 `json:"min"`
|
||||
Max float64 `json:"max"`
|
||||
Avg float64 `json:"Avg"`
|
||||
Min float64 `json:"Min"`
|
||||
Max float64 `json:"Max"`
|
||||
}
|
||||
|
||||
type MetricSeries struct {
|
||||
NodeID string `json:"node_id"`
|
||||
Statistics *MetricStatistics `json:"statistics"`
|
||||
Data []Float `json:"data"`
|
||||
Hostname string `json:"Hostname"`
|
||||
Id int `json:"Id"`
|
||||
Statistics *MetricStatistics `json:"Statistics"`
|
||||
Data []Float `json:"Data"`
|
||||
}
|
||||
|
||||
type JobMetaStatistics struct {
|
||||
Unit string `json:"unit"`
|
||||
Avg float64 `json:"avg"`
|
||||
Min float64 `json:"min"`
|
||||
Max float64 `json:"max"`
|
||||
Unit string `json:"Unit"`
|
||||
Avg float64 `json:"Avg"`
|
||||
Min float64 `json:"Min"`
|
||||
Max float64 `json:"Max"`
|
||||
}
|
||||
|
||||
type Accelerator struct {
|
||||
ID int `json:"Id"`
|
||||
Type string `json:"Type"`
|
||||
Model string `json:"Model"`
|
||||
}
|
||||
|
||||
type JobResource struct {
|
||||
Hostname string `json:"Hostname"`
|
||||
HWThreads []int `json:"HWThreads,omitempty"`
|
||||
Accelerators []Accelerator `json:"Accelerators,omitempty"`
|
||||
}
|
||||
|
||||
// Format of `meta.json` files.
|
||||
type JobMeta struct {
|
||||
JobId string `json:"job_id"`
|
||||
UserId string `json:"user_id"`
|
||||
ProjectId string `json:"project_id"`
|
||||
ClusterId string `json:"cluster_id"`
|
||||
NumNodes int `json:"num_nodes"`
|
||||
JobState string `json:"job_state"`
|
||||
StartTime int64 `json:"start_time"`
|
||||
Duration int64 `json:"duration"`
|
||||
Nodes []string `json:"nodes"`
|
||||
Tags []struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
} `json:"tags"`
|
||||
Statistics map[string]*JobMetaStatistics `json:"statistics"`
|
||||
JobId int64 `json:"JobId"`
|
||||
User string `json:"User"`
|
||||
Project string `json:"Project"`
|
||||
Cluster string `json:"Cluster"`
|
||||
NumNodes int `json:"NumNodes"`
|
||||
NumHWThreads int `json:"NumHWThreads"`
|
||||
NumAcc int `json:"NumAcc"`
|
||||
Exclusive int8 `json:"Exclusive"`
|
||||
MonitoringStatus int8 `json:"MonitoringStatus"`
|
||||
SMT int8 `json:"SMT"`
|
||||
Partition string `json:"Partition"`
|
||||
ArrayJobId int `json:"ArrayJobId"`
|
||||
JobState string `json:"JobState"`
|
||||
StartTime int64 `json:"StartTime"`
|
||||
Duration int64 `json:"Duration"`
|
||||
Resources []*JobResource `json:"Resources"`
|
||||
MetaData string `json:"MetaData"`
|
||||
Tags []struct {
|
||||
Name string `json:"Name"`
|
||||
Type string `json:"Type"`
|
||||
} `json:"Tags"`
|
||||
Statistics map[string]*JobMetaStatistics `json:"Statistics"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user