opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.13k stars 1.01k forks source link

Log the origin of a request that causes a transfer cache addition. #5874

Closed jtorin closed 1 month ago

jtorin commented 1 month ago

Summary

With this change it's possible to differentiate between entries added because of configuration and those from runtime requests, the latter being candidates for the former.

From config:

Initializing cache with request: StreetRelevantOptions{transferMode: WALK, walk: WalkPreferences{speed: 0.69, boardCost: $0}, street: StreetPreferences{accessEgress: AccessEgressPreferences{maxDuration: DurationForStreetMode{default:50m, WALK:48m10s}}, maxDirectDuration: DurationForStreetMode{default:1h1m40s, CAR:1d}}}

From runtime:

Adding runtime request to cache: StreetRelevantOptions{transferMode: WALK, street: StreetPreferences{accessEgress: AccessEgressPreferences{maxDuration: DurationForStreetMode{default:50m}}, maxDirectDuration: DurationForStreetMode{default:1h1m40s, CAR:1d}}}

Issue

This makes it much easier to find and handle new transfer cache additions in the logs.

Testing

Manually tested for both cases.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.38%. Comparing base (39a7270) to head (e9b1e93). Report is 2 commits behind head on dev-2.x.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev-2.x #5874 +/- ## ========================================== Coverage 68.37% 68.38% - Complexity 16680 16683 +3 ========================================== Files 1914 1914 Lines 72658 72664 +6 Branches 7453 7453 ========================================== + Hits 49683 49691 +8 + Misses 20418 20416 -2 Partials 2557 2557 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.