Skip to content

Commit e12a498

Browse files
committed
[Scheduled Actions] Record ScheduleActionDelay in CHASM scheduler, remove some unused metric definitions
1 parent 563f68c commit e12a498

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

chasm/lib/scheduler/invoker_tasks.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,14 @@ func (e *InvokerExecuteTaskExecutor) startWorkflow(
547547
return nil, err
548548
}
549549

550+
// realTime may be slightly past the time of the action's first scheduled WFT.
551+
realTime := time.Now()
552+
desiredTime := start.ActualTime
553+
e.MetricsHandler.Timer(metrics.ScheduleActionDelay.Name()).Record(realTime.Sub(desiredTime.AsTime()))
554+
550555
return &schedulepb.ScheduleActionResult{
551-
ScheduleTime: start.ActualTime,
552-
ActualTime: timestamppb.New(time.Now()),
556+
ScheduleTime: desiredTime,
557+
ActualTime: timestamppb.New(realTime),
553558
StartWorkflowResult: &commonpb.WorkflowExecution{
554559
WorkflowId: workflowID,
555560
RunId: result.RunId,

common/metrics/metric_defs.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,10 +1216,6 @@ var (
12161216
"schedule_action_success",
12171217
WithDescription("The number of schedule actions that were successfully taken by a schedule"),
12181218
)
1219-
ScheduleActionAttempt = NewCounterDef(
1220-
"schedule_action_attempt",
1221-
WithDescription("The number of schedule actions attempts"),
1222-
)
12231219
ScheduleActionErrors = NewCounterDef(
12241220
"schedule_action_errors",
12251221
WithDescription("The number of failed attempts from starting schedule actions"),
@@ -1236,10 +1232,6 @@ var (
12361232
"schedule_action_delay",
12371233
WithDescription("Delay between when scheduled actions should/actually happen"),
12381234
)
1239-
ScheduleActionDropped = NewCounterDef(
1240-
"schedule_action_dropped",
1241-
WithDescription("The number of schedule actions that failed to start"),
1242-
)
12431235

12441236
// Worker Versioning
12451237
WorkerDeploymentCreated = NewCounterDef("worker_deployment_created")

0 commit comments

Comments
 (0)