
Add a new API operation to get the overall farm status. This is based on the jobs and workers, and their status. The statuses are: - `active`: Actively working on jobs. - `idle`: Farm could be active, but has no work to do. - `waiting`: Work has been queued, but all workers are asleep. - `asleep`: Farm is idle, and all workers are asleep. - `inoperative`: Cannot work: no workers, or all are offline/error. - `starting`: Farm is starting up. - `unknown`: Unexpected configuration of worker and job statuses.
67 lines
2.5 KiB
Go
Generated
67 lines
2.5 KiB
Go
Generated
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: projects.blender.org/studio/flamenco/internal/manager/farmstatus (interfaces: PersistenceService)
|
|
|
|
// Package mocks is a generated GoMock package.
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
|
|
gomock "github.com/golang/mock/gomock"
|
|
persistence "projects.blender.org/studio/flamenco/internal/manager/persistence"
|
|
)
|
|
|
|
// MockPersistenceService is a mock of PersistenceService interface.
|
|
type MockPersistenceService struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockPersistenceServiceMockRecorder
|
|
}
|
|
|
|
// MockPersistenceServiceMockRecorder is the mock recorder for MockPersistenceService.
|
|
type MockPersistenceServiceMockRecorder struct {
|
|
mock *MockPersistenceService
|
|
}
|
|
|
|
// NewMockPersistenceService creates a new mock instance.
|
|
func NewMockPersistenceService(ctrl *gomock.Controller) *MockPersistenceService {
|
|
mock := &MockPersistenceService{ctrl: ctrl}
|
|
mock.recorder = &MockPersistenceServiceMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockPersistenceService) EXPECT() *MockPersistenceServiceMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// SummarizeJobStatuses mocks base method.
|
|
func (m *MockPersistenceService) SummarizeJobStatuses(arg0 context.Context) (persistence.JobStatusCount, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "SummarizeJobStatuses", arg0)
|
|
ret0, _ := ret[0].(persistence.JobStatusCount)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// SummarizeJobStatuses indicates an expected call of SummarizeJobStatuses.
|
|
func (mr *MockPersistenceServiceMockRecorder) SummarizeJobStatuses(arg0 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SummarizeJobStatuses", reflect.TypeOf((*MockPersistenceService)(nil).SummarizeJobStatuses), arg0)
|
|
}
|
|
|
|
// SummarizeWorkerStatuses mocks base method.
|
|
func (m *MockPersistenceService) SummarizeWorkerStatuses(arg0 context.Context) (persistence.WorkerStatusCount, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "SummarizeWorkerStatuses", arg0)
|
|
ret0, _ := ret[0].(persistence.WorkerStatusCount)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// SummarizeWorkerStatuses indicates an expected call of SummarizeWorkerStatuses.
|
|
func (mr *MockPersistenceServiceMockRecorder) SummarizeWorkerStatuses(arg0 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SummarizeWorkerStatuses", reflect.TypeOf((*MockPersistenceService)(nil).SummarizeWorkerStatuses), arg0)
|
|
}
|