Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug: Add loggin before/after various routing functions #1048

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

tahini
Copy link
Collaborator

@tahini tahini commented Sep 13, 2024

To investigate issue #1011 on instances, we add logs before and after
the calculation functions, each individual mode calculation and the
trRouting requests. The log messages include the origin/destination
coordinates to allow to track individual queries. These can be matched
with the odTripIndex from a log message in the batch routing task.

Copy link
Collaborator

@greenscientist greenscientist left a comment

Choose a reason for hiding this comment

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

Accepting, but the const origDestStr = ${odTrip.attributes.origin_geography.coordinates.join(',')} to ${odTrip.attributes.destination_geography.coordinates.join(',')};
that repeats in many place would benefit being in a function that simply both the origin and destination

@@ -145,7 +145,8 @@ class TrRoutingBatch {
console.log(
'calc/sec',
Math.round(
(100 * completedRoutingsCount) / ((1 / 1000) * (performance.now() - benchmarkStart))
(100 * (completedRoutingsCount - startIndex)) /
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is starting to get complex, would benefit having a comment

@@ -123,7 +123,10 @@ export class Routing {
// ** backend
const routingPromises: Promise<TransitOrRouteCalculatorResult>[] = [];

console.log(`Routing beginning with ${routingAttributes.routingModes.length} modes`);
const origDestStr = `${routingAttributes.originGeojson.geometry.coordinates.join(',')} to ${routingAttributes.destinationGeojson.geometry.coordinates.join(',')}`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

could be nice to be in a "toString" function instead

When a job starts from a checkpoint, we need to substract the `startIndex`
from the `completedRoutingCount` to get the actual of calculations done,
otherwise we get slowly decreasing results.
To investigate issue chairemobilite#1011 on instances, we add logs before and after
the calculation functions, each individual mode calculation and the
trRouting requests. The log messages include the origin/destination
coordinates to allow to track individual queries. These can be matched
with the odTripIndex from a log message in the batch routing task.
@tahini
Copy link
Collaborator Author

tahini commented Sep 13, 2024

Added a comment for calculation, I'll open an issue for the utility function, as we may not necessarily want to keep the logs as is for the future. This is for very short term debugging

@greenscientist
Copy link
Collaborator

Added a comment for calculation, I'll open an issue for the utility function, as we may not necessarily want to keep the logs as is for the future. This is for very short term debugging

Ok. But printing an OD pair seems to be a very useful things for us in general!

@tahini tahini merged commit 657976c into chairemobilite:main Sep 13, 2024
6 checks passed
@tahini tahini deleted the logBatch branch September 13, 2024 15:51
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.

2 participants