Skip to content

Commit ecfb508

Browse files
set worker kind for agent jobs (#1140)
* set worker kind for agent jobs * generated protobuf --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent becd101 commit ecfb508

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

observability/agentsobs/gen_reporter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ type WorkerReporter interface {
5858
ReportStatus(v WorkerStatus)
5959
ReportStartTime(v time.Time)
6060
ReportJobsCurrent(v uint32)
61-
ReportKind(v AgentKind)
6261
ReportCPU(v int64)
6362
ReportCPULimit(v int64)
6463
ReportMem(v int64)
@@ -74,7 +73,6 @@ type WorkerTx interface {
7473
ReportStatus(v WorkerStatus)
7574
ReportStartTime(v time.Time)
7675
ReportJobsCurrent(v uint32)
77-
ReportKind(v AgentKind)
7876
ReportCPU(v int64)
7977
ReportCPULimit(v int64)
8078
ReportMem(v int64)
@@ -91,6 +89,7 @@ type JobReporter interface {
9189
TxAt(time.Time, func(tx JobTx))
9290
ReportRoomSessionID(v string)
9391
ReportKind(v JobKind)
92+
ReportWorkerKind(v WorkerKind)
9493
ReportStatus(v JobStatus)
9594
ReportDuration(v uint32)
9695
ReportDurationMinutes(v uint8)
@@ -102,6 +101,7 @@ type JobReporter interface {
102101
type JobTx interface {
103102
ReportRoomSessionID(v string)
104103
ReportKind(v JobKind)
104+
ReportWorkerKind(v WorkerKind)
105105
ReportStatus(v JobStatus)
106106
ReportDuration(v uint32)
107107
ReportDurationMinutes(v uint8)

observability/agentsobs/gen_reporter_noop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ func (r *noopWorkerReporter) ReportLoad(v float32)
9595
func (r *noopWorkerReporter) ReportStatus(v WorkerStatus) {}
9696
func (r *noopWorkerReporter) ReportStartTime(v time.Time) {}
9797
func (r *noopWorkerReporter) ReportJobsCurrent(v uint32) {}
98-
func (r *noopWorkerReporter) ReportKind(v AgentKind) {}
9998
func (r *noopWorkerReporter) ReportCPU(v int64) {}
10099
func (r *noopWorkerReporter) ReportCPULimit(v int64) {}
101100
func (r *noopWorkerReporter) ReportMem(v int64) {}
@@ -122,6 +121,7 @@ func (r *noopJobReporter) Tx(f func(JobTx)) {}
122121
func (r *noopJobReporter) TxAt(ts time.Time, f func(JobTx)) {}
123122
func (r *noopJobReporter) ReportRoomSessionID(v string) {}
124123
func (r *noopJobReporter) ReportKind(v JobKind) {}
124+
func (r *noopJobReporter) ReportWorkerKind(v WorkerKind) {}
125125
func (r *noopJobReporter) ReportStatus(v JobStatus) {}
126126
func (r *noopJobReporter) ReportDuration(v uint32) {}
127127
func (r *noopJobReporter) ReportDurationMinutes(v uint8) {}

observability/agentsobs/gen_source.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ const (
99
WorkerStatusFull WorkerStatus = "full"
1010
)
1111

12-
type AgentKind string
13-
14-
const (
15-
AgentKindUndefined AgentKind = ""
16-
AgentKindCloud AgentKind = "cloud"
17-
AgentKindSelfhost AgentKind = "selfhost"
18-
)
19-
2012
type WorkerState string
2113

2214
const (
@@ -34,6 +26,14 @@ const (
3426
JobKindParticipant JobKind = "participant"
3527
)
3628

29+
type WorkerKind string
30+
31+
const (
32+
WorkerKindUndefined WorkerKind = ""
33+
WorkerKindCloud WorkerKind = "cloud"
34+
WorkerKindSelfhost WorkerKind = "selfhost"
35+
)
36+
3737
type JobStatus string
3838

3939
const (

0 commit comments

Comments
 (0)