Skip to content
Snippets Groups Projects
Verified Commit 586cb3b8 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

feat: new worker mehtod GetStatistic()

parent 97c97037
No related branches found
No related tags found
No related merge requests found
......@@ -5,9 +5,9 @@
</component>
<component name="ChangeListManager">
<list default="true" id="9979eb22-471e-4f2f-b624-fd3edb5e8c6e" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/flake.nix" beforeDir="false" afterPath="$PROJECT_DIR$/flake.nix" afterDir="false" />
<change beforePath="$PROJECT_DIR$/manager_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/manager_test.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/worker.go" beforeDir="false" afterPath="$PROJECT_DIR$/worker.go" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -255,7 +255,8 @@
<option name="presentableId" value="Default" />
<updated>1734001333374</updated>
<workItem from="1734001335693" duration="5602000" />
<workItem from="1734012566872" duration="3847000" />
<workItem from="1734012566872" duration="4517000" />
<workItem from="1734022155342" duration="253000" />
</task>
<servers />
</component>
......
......@@ -37,6 +37,10 @@ func (m *MockWorker) SetManager(manager *Manager) {
return
}
func (m *MockWorker) GetStatistic() Statistic {
return Statistic{}
}
func (m *MockWorker) AssignJob(job GenericJob) error {
return nil
}
......
......@@ -37,15 +37,16 @@ type Worker interface {
GetID() WorkerID
SetManager(manager *Manager)
GetStatistic() Statistic
}
type Statistic struct {
TotalThreads int
ActiveThreads int
JobsAssigned int
JobsCompleted int
FailedJobs int
TotalExecutionTime time.Duration
TotalThreads int `json:"totalThreads"`
ActiveThreads int `json:"activeThreads"`
JobsAssigned int `json:"jobsAssigned"`
JobsCompleted int `json:"jobsVompleted"`
FailedJobs int `json:"failedJobs"`
TotalExecutionTime time.Duration `json:"totalExecution_time"`
}
func (s *Statistic) AverageExecutionTime() time.Duration {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment