Skip to content

feat(metrics): (#401) Add support for realtime trip counts matched in MetricsBean - #415

Merged
aaronbrethorst merged 2 commits into
OneBusAway:mainfrom
0xaboomar:feature/matched-trip-count
Mar 20, 2025
Merged

aaronbrethorst merged 2 commits into
OneBusAway:mainfrom
0xaboomar:feature/matched-trip-count

Conversation

@0xaboomar

Copy link
Copy Markdown
Member

Summary

This pull request adds support for calculating and storing the count of real-time trips matched to scheduled trips on a per-agency basis in the MetricsBean. This enhancement is part of the effort to extract code from the onebusaway-watchdog-webapp module and move it into onebusaway-transit-data-federation and onebusaway-api-webapp to create a new, easier-to-use Metrics API.

Resolves issue #401: Implement matched trip count in Metrics API.

Changes

  1. MetricsBean.java

    • Added a new field realtimeTripCountsMatched to store the count of real-time trips matched to scheduled trips on a per-agency basis.
    • Implemented getters and setters for the new field.
    • Organized the code to follow Java conventions.
  2. MetricsBeanServiceImpl.java

    • Implemented populateRealtimeTripFields() method to populate the realtimeTripCountsMatched field in MetricsBean.
    • Added getRealtimeTripCountsMatched() method to calculate the count of matched trips on a per-agency basis.
    • Added getValidRealtimeTripIds() method to retrieve valid real-time trip IDs for a specified agency and optional feed.

@CLAassistant

CLAassistant commented Mar 12, 2025 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@aaronbrethorst aaronbrethorst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rebase against the latest changes in main and remove the excess whitespace from lines 39 and 55 of MetricsBeanServiceImpl

@0xaboomar
0xaboomar force-pushed the feature/matched-trip-count branch from a4bd772 to 7106184 Compare March 13, 2025 02:55
@0xaboomar

Copy link
Copy Markdown
Member Author

@aaronbrethorst , I've resolved the merge conflicts and made the required changes. Looking forward to your review—please let me know if any further adjustments are needed.

@aaronbrethorst

Copy link
Copy Markdown
Member

@Abo-Omar-74 looks like you have a build failure!

@0xaboomar
0xaboomar force-pushed the feature/matched-trip-count branch from 6c9f11b to a648f50 Compare March 14, 2025 03:13
@0xaboomar

Copy link
Copy Markdown
Member Author

@aaronbrethorst , I have resolved it. The build error occurred because populateRealtimeTripFields() was implemented twice, and I overlooked it while resolving the conflict.

@0xaboomar
0xaboomar force-pushed the feature/matched-trip-count branch from a648f50 to ef88a52 Compare March 16, 2025 00:29
- Added a new field  to store the count of realtime trips matched to scheduled trips on a per-agency basis.

- Added getters and setters for the new field.

- Organized the code to follow Java conventions.

- Implemented  to retrieve matched trip counts per agency.

- Added getValidRealtimeTripIds() method  to fetch valid real-time trip IDs based on agency and feed.

- Updated populateRealtimeTripFields() method  to populate matched trip counts in .
…nServiceImpl

- Added necessary comments in MetricsBeanServiceImpl.java to document that
  getValidRealtimeTripIds was ported from onebusaway-watchdog-webapp.
@0xaboomar
0xaboomar force-pushed the feature/matched-trip-count branch from ef88a52 to 439d86d Compare March 18, 2025 03:28

@aaronbrethorst aaronbrethorst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! great work 👍

@aaronbrethorst
aaronbrethorst merged commit b21b3ed into OneBusAway:main Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants