1 | | | /// Base statistics for worker. |
2 | | | class WorkerStat { |
3 | | 2 | WorkerStat( |
4 | | | this.workerType, |
5 | | | this.id, |
6 | | | this.isStopped, |
7 | | | this.status, |
8 | | | this.workload, |
9 | | | this.maxWorkload, |
10 | | | this.totalWorkload, |
11 | | | this.totalErrors, |
12 | | | this.upTime, |
13 | | | this.idleTime); |
14 | | |
|
15 | | | /// The worker's runtime type. |
16 | | | final Type workerType; |
17 | | |
|
18 | | | /// The worker ID. |
19 | | | final String id; |
20 | | |
|
21 | | | /// Worker running flag. |
22 | | | final bool isStopped; |
23 | | |
|
24 | | | /// Worker status. |
25 | | | final String status; |
26 | | |
|
27 | | | /// Current workload being processed by the worker. |
28 | | | final int workload; |
29 | | |
|
30 | | | /// Maximum concurrent workload processed by the worker. |
31 | | | final int maxWorkload; |
32 | | |
|
33 | | | /// Total workload processed by the worker. |
34 | | | final int totalWorkload; |
35 | | |
|
36 | | | /// Total errors raised during processing. |
37 | | | final int totalErrors; |
38 | | |
|
39 | | | /// The worker's up-time. |
40 | | | Duration upTime; |
41 | | |
|
42 | | | /// The worker's idle-time. |
43 | | | Duration idleTime; |
44 | | |
|
45 | | 0 | @override |
46 | | 0 | String toString() => |
47 | | 0 | '$workerType $id: $status, load = $workload (max = $maxWorkload, total = $totalWorkload, errors = $totalErrors), uptime = $upTime, idle = $idleTime'; |
48 | | | } |