forked from clemsonciti/jobperf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnodestats.go
46 lines (37 loc) · 1.08 KB
/
nodestats.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package jobperf
import (
"encoding/json"
"time"
)
type NodeStatsRequestType int
const (
NodeStatsRequestTypeSampleCPUMemSlurmCGroup NodeStatsRequestType = iota
NodeStatsRequestTypeSampleCPUMemSlurmLinux
NodeStatsRequestTypeSampleCPUMemPBS
NodeStatsRequestTypeSampleGPUNvidia
NodeStatsRequestTypeExit
)
type NodeStatsRequest struct {
RequestType NodeStatsRequestType `json:"type"`
Payload json.RawMessage `json:"payload"`
}
type NodeStatsCPUMemSlurmPayload struct {
JobID string `json:"job_id"`
UserID string `json:"user_id"`
}
type NodeStatsCPUMemPBSPayload struct {
JobID string `json:"job_id"`
}
type NodeStatsCPUMem struct {
SampleTime time.Time `json:"sample_time"`
CPUTime time.Duration `json:"cpu_time"`
MemoryUsedBytes Bytes `json:"memory_bytes"`
MaxMemoryUsedBytes Bytes `json:"max_memory_bytes"`
Hostname string `json:"hostname"`
}
type NodeStatsGPU []GPUStat
type NodeStatsSession interface {
RequestCPUStats() (*NodeStatsCPUMem, error)
RequestGPUStats() (*NodeStatsGPU, error)
Close() error
}