-
Notifications
You must be signed in to change notification settings - Fork 15
Vehicle Position Validation Metrics #42
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
base: main
Are you sure you want to change the base?
Conversation
|
||
//Count invalid postions | ||
for _, vehicle := range realTimeData.Vehicles { | ||
fmt.Println(float64(*vehicle.Position.Latitude), float64(*vehicle.Position.Longitude)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
little doubtful about this part, need to test with actual data.
@aaronbrethorst Can you please review this when you get time? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will do exactly what it says it will, but I have two requests before merging:
- instead of looking at whether the positions of vehicles are globally valid or invalid, please extract the boundaries of the current region from the shapes data (the GTFS library may have this functionality built in), and then see if each vehicle point is within the boundaries or not.
- Please add some basic unit tests.
thanks for pitching in! :)
ack. will work on these |
@aaronbrethorst This is gtg for review, I see another PR adding tests for the rest of the gtfs file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements vehicle position validation metrics by introducing new Prometheus gauges and region boundary extraction functionality from GTFS static data. Key changes include:
- Adding two new gauge metrics (invalid vehicle positions count and valid vehicle positions percentage) in metrics.go.
- Introducing functions for extracting region boundaries and validating vehicle positions in gtfs-realtime-bindings.go.
- Adding tests for boundary validation and region extraction in gtfs-realtime-bindings_test.go.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
internal/metrics/metrics.go | Adds new gauge metrics for vehicle position validation. |
internal/metrics/gtfs-realtime-bindings_test.go | Provides test coverage for boundary extraction and position validation. |
internal/metrics/gtfs-realtime-bindings.go | Implements region boundary extraction, validation functions and updates the vehicle position count function. |
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (1)
internal/metrics/gtfs-realtime-bindings.go:195
- [nitpick] There are two similar functions: 'CountVehiclePositions' and 'CountVehiclePosition'. Consider renaming one of them to clearly differentiate their purposes and avoid confusion.
func CountVehiclePosition(server models.ObaServer) (int, error) {
a5b7c74
to
0add21f
Compare
Signed-off-by: Rohan Hasabe <[email protected]>
d8e1670
to
cea1e39
Compare
coveralls is down for maintenance, thus the failed build |
For #41