forked from phc/cluster-dashboard
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
Go
47 lines
1.2 KiB
Go
package executor
|
|
|
|
var _ Service = &Mock{}
|
|
|
|
type Mock struct {
|
|
SlurmQueueFunc func() ([]string, error)
|
|
SlurmJobsFunc func() ([]string, error)
|
|
NodeUptimeFunc func(hostname string) (string, error)
|
|
TemperatureFunc func(hostname string) (string, error)
|
|
MemoryUsageFunc func(hostname string) (string, error)
|
|
StorageUsageFunc func(hostname string) (string, error)
|
|
NetworkUploadFunc func(hostname string) (string, error)
|
|
NetworkDownloadFunc func(hostname string) (string, error)
|
|
}
|
|
|
|
func (m Mock) SlurmQueue() ([]string, error) {
|
|
return m.SlurmQueueFunc()
|
|
}
|
|
|
|
func (m Mock) SlurmJobs() ([]string, error) {
|
|
return m.SlurmJobsFunc()
|
|
}
|
|
|
|
func (m Mock) NodeUptime(hostname string) (string, error) {
|
|
return m.NodeUptimeFunc(hostname)
|
|
}
|
|
|
|
func (m Mock) Temperature(hostname string) (string, error) {
|
|
return m.TemperatureFunc(hostname)
|
|
}
|
|
|
|
func (m Mock) MemoryUsage(hostname string) (string, error) {
|
|
return m.MemoryUsageFunc(hostname)
|
|
}
|
|
|
|
func (m Mock) StorageUsage(hostname string) (string, error) {
|
|
return m.StorageUsageFunc(hostname)
|
|
}
|
|
|
|
func (m Mock) NetworkUpload(hostname string) (string, error) {
|
|
return m.NetworkUploadFunc(hostname)
|
|
}
|
|
|
|
func (m Mock) NetworkDownload(hostname string) (string, error) {
|
|
return m.NetworkDownloadFunc(hostname)
|
|
}
|