Skip to content

Commit

Permalink
Add total scheduled rides counters for each area in videowall SLA task
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-vasconcelos committed Feb 5, 2025
1 parent 47401aa commit 3b7bd08
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps/sync-metrics/src/tasks/videowall-sla.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,35 @@ export const videowallSla = async () => {
const responseResult = {

// For Area 1
_41_scheduled_rides_total: 0,
_41_scheduled_rides_until_now: 0,
_41_simple_one_validation_transaction_fail_until_now: 0,
_41_simple_three_events_fail_until_now: 0,
_41_simple_three_events_or_simple_one_validation_transaction_fail_until_now: 0,

// For Area 2
_42_scheduled_rides_total: 0,
_42_scheduled_rides_until_now: 0,
_42_simple_one_validation_transaction_fail_until_now: 0,
_42_simple_three_events_fail_until_now: 0,
_42_simple_three_events_or_simple_one_validation_transaction_fail_until_now: 0,

// For Area 3
_43_scheduled_rides_total: 0,
_43_scheduled_rides_until_now: 0,
_43_simple_one_validation_transaction_fail_until_now: 0,
_43_simple_three_events_fail_until_now: 0,
_43_simple_three_events_or_simple_one_validation_transaction_fail_until_now: 0,

// For Area 4
_44_scheduled_rides_total: 0,
_44_scheduled_rides_until_now: 0,
_44_simple_one_validation_transaction_fail_until_now: 0,
_44_simple_three_events_fail_until_now: 0,
_44_simple_three_events_or_simple_one_validation_transaction_fail_until_now: 0,

// For the whole CM
_cm_scheduled_rides_total: 0,
_cm_scheduled_rides_until_now: 0,
_cm_simple_one_validation_transaction_fail_until_now: 0,
_cm_simple_three_events_fail_until_now: 0,
Expand All @@ -72,6 +77,12 @@ export const videowallSla = async () => {
for await (const rideData of allRidesForTodayStream) {
//

responseResult._cm_scheduled_rides_total++;
if (rideData.agency_id === '41') responseResult._41_scheduled_rides_total++;
if (rideData.agency_id === '42') responseResult._42_scheduled_rides_total++;
if (rideData.agency_id === '43') responseResult._43_scheduled_rides_total++;
if (rideData.agency_id === '44') responseResult._44_scheduled_rides_total++;

//
// Skip rides that should not have started yet (scheduled for the future)

Expand Down

0 comments on commit 3b7bd08

Please sign in to comment.