Skip to content

Commit 5e50b1b

Browse files
Show backlog flow rates on the Waterline dashboard
1 parent 7791100 commit 5e50b1b

4 files changed

Lines changed: 31 additions & 2 deletions

File tree

public/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"/app.js": "/app.js?id=ab23f48b8c63bef65e4f9fbbc3543cf4",
2+
"/app.js": "/app.js?id=aa9ed769564fbcb973698c985e5b8c9e",
33
"/app-dark.css": "/app-dark.css?id=8b1b08a71c8e9860d0a9030d902c30d0",
44
"/app.css": "/app.css?id=4d346e04fa466f5227cee3c313fbea25",
55
"/img/favicon.png": "/img/favicon.png?id=7c006241b093796d6abfa3049df93a59",

resources/js/screens/dashboard.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@
300300
{{ operatorMetricLabel('backlog', 'delayed_tasks') }} delayed,
301301
{{ operatorMetricLabel('backlog', 'leased_tasks') }} leased
302302
</div>
303+
<div class="wl-operator-metric__meta">
304+
{{ operatorMetricLabel('backlog', 'tasks_added_last_minute') }} added last minute,
305+
{{ operatorMetricLabel('backlog', 'tasks_dispatched_last_minute') }} dispatched last minute
306+
</div>
303307
<div v-if="operatorReadyDueAgeAvailable()" class="wl-operator-metric__meta">
304308
oldest ready {{ operatorDurationMetricLabel('tasks', 'max_ready_due_age_ms') }} waiting
305309
<template v-if="operatorReadyDueOldestAt()">

tests/Feature/V2DashboardStatsControllerTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,8 @@ public function testIndexIncludesV2OperatorMetrics(): void
454454
->assertJsonPath('operator_metrics.tasks.lease_expired', 0)
455455
->assertJsonPath('operator_metrics.tasks.unhealthy', 1)
456456
->assertJsonPath('operator_metrics.backlog.runnable_tasks', 2)
457+
->assertJsonPath('operator_metrics.backlog.tasks_added_last_minute', 2)
458+
->assertJsonPath('operator_metrics.backlog.tasks_dispatched_last_minute', 0)
457459
->assertJsonPath('operator_metrics.backlog.retrying_activities', 1)
458460
->assertJsonPath('operator_metrics.backlog.repair_needed_runs', 1)
459461
->assertJsonPath('operator_metrics.backlog.claim_failed_runs', 1)
@@ -761,6 +763,29 @@ public function testIndexExposesCompatibilityBlockedAge(): void
761763
);
762764
}
763765

766+
public function testIndexExposesBacklogFlowRates(): void
767+
{
768+
config()->set('waterline.engine_source', 'v2');
769+
770+
$response = $this->get('/waterline/api/stats')->assertStatus(200);
771+
772+
$backlog = $response->json('operator_metrics.backlog');
773+
774+
$this->assertIsArray($backlog);
775+
776+
foreach (['tasks_added_last_minute', 'tasks_dispatched_last_minute'] as $key) {
777+
$this->assertArrayHasKey(
778+
$key,
779+
$backlog,
780+
sprintf('operator_metrics.backlog.%s must be present in the dashboard payload', $key),
781+
);
782+
$this->assertIsInt(
783+
$backlog[$key],
784+
sprintf('operator_metrics.backlog.%s must be an integer count', $key),
785+
);
786+
}
787+
}
788+
764789
public function testIndexExposesStuckLeaseAge(): void
765790
{
766791
config()->set('waterline.engine_source', 'v2');

0 commit comments

Comments
 (0)