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

feat: accept MQTT connections for Vehicle Positions #673

Merged
merged 5 commits into from
Oct 3, 2023
Merged

Conversation

paulswartz
Copy link
Member

@paulswartz paulswartz commented Sep 17, 2023

Summary of changes

Creates a new MqttMediator which accepts messages from an MQTT topic and sends them to the appropriate State module. We hook this up to the Vehicle state to more efficiently accept vehicle location updates.

Asana Ticket: V3 API: Consume MQTT updates

@paulswartz paulswartz force-pushed the ps-mqtt branch 7 times, most recently from 9bd8d86 to 4184923 Compare September 20, 2023 13:30
@mbta mbta deleted a comment from github-actions bot Sep 20, 2023
@mbta mbta deleted a comment from github-actions bot Sep 20, 2023
@paulswartz paulswartz requested review from a team and bfauble September 20, 2023 13:33
@paulswartz paulswartz marked this pull request as ready for review September 20, 2023 13:34
@github-actions
Copy link

Coverage of commit 708210f

Summary coverage rate:
  lines......: 89.5% (4083 of 4564 lines)
  functions..: 70.9% (2232 of 3149 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/parse/lib/parse/vehicle_positions.ex                             |50.0%     46| 100%     7|    -      0
  apps/parse/lib/parse/vehicle_positions_json.ex                        |67.9%     28| 100%     7|    -      0
  apps/state/lib/state/server.ex                                        |92.0%    113|96.7%    30|    -      0
  apps/state_mediator/lib/state_mediator.ex                             |15.0%     20|16.7%     6|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator.ex               |77.3%     22|62.5%     8|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator/handler.ex       |77.8%      9|85.7%     7|    -      0

Download coverage report

@paulswartz paulswartz temporarily deployed to dev-green September 20, 2023 14:36 — with GitHub Actions Inactive
@github-actions
Copy link

Coverage of commit ca81edc

Summary coverage rate:
  lines......: 89.5% (4089 of 4569 lines)
  functions..: 70.9% (2231 of 3148 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/parse/lib/parse/vehicle_positions.ex                             |50.0%     46| 100%     7|    -      0
  apps/parse/lib/parse/vehicle_positions_json.ex                        |67.9%     28| 100%     7|    -      0
  apps/state/lib/state/route.ex                                         |75.9%     29|68.0%    50|    -      0
  apps/state/lib/state/route_pattern.ex                                 | 100%     23|64.3%    42|    -      0
  apps/state/lib/state/server.ex                                        |93.2%    117|96.7%    30|    -      0
  apps/state_mediator/lib/state_mediator.ex                             |15.0%     20|16.7%     6|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator.ex               |77.3%     22|62.5%     8|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator/handler.ex       |77.8%      9|85.7%     7|    -      0

Download coverage report

@paulswartz
Copy link
Member Author

Moving back to draft while I investigate an issue with excess memory usage.

@paulswartz paulswartz marked this pull request as draft September 20, 2023 18:42
@paulswartz paulswartz temporarily deployed to dev-green September 20, 2023 20:08 — with GitHub Actions Inactive
@github-actions
Copy link

Coverage of commit c80435b

Summary coverage rate:
  lines......: 89.5% (4087 of 4569 lines)
  functions..: 70.8% (2221 of 3135 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/parse/lib/parse/vehicle_positions.ex                             |50.0%     46| 100%     7|    -      0
  apps/parse/lib/parse/vehicle_positions_json.ex                        |67.9%     28| 100%     7|    -      0
  apps/state/lib/state/route.ex                                         |75.9%     29|67.3%    49|    -      0
  apps/state/lib/state/route_pattern.ex                                 | 100%     23|63.4%    41|    -      0
  apps/state/lib/state/server.ex                                        |93.2%    117|96.7%    30|    -      0
  apps/state_mediator/lib/state_mediator.ex                             |15.0%     20|16.7%     6|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator.ex               |77.3%     22|62.5%     8|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator/handler.ex       |77.8%      9|85.7%     7|    -      0

Download coverage report

@github-actions
Copy link

Coverage of commit ac7347d

Summary coverage rate:
  lines......: 89.5% (4093 of 4573 lines)
  functions..: 70.8% (2221 of 3135 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/parse/lib/parse/vehicle_positions.ex                             |50.0%     46| 100%     7|    -      0
  apps/parse/lib/parse/vehicle_positions_json.ex                        |67.9%     28| 100%     7|    -      0
  apps/state/lib/state/route.ex                                         |75.9%     29|67.3%    49|    -      0
  apps/state/lib/state/route_pattern.ex                                 | 100%     23|63.4%    41|    -      0
  apps/state/lib/state/server.ex                                        |93.3%    120|96.7%    30|    -      0
  apps/state/lib/state/vehicle.ex                                       |91.9%     37|72.9%    48|    -      0
  apps/state_mediator/lib/state_mediator.ex                             |15.0%     20|16.7%     6|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator.ex               |77.3%     22|62.5%     8|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator/handler.ex       |77.8%      9|85.7%     7|    -      0

Download coverage report

@github-actions
Copy link

Coverage of commit aa70cdd

Summary coverage rate:
  lines......: 89.4% (4092 of 4576 lines)
  functions..: 70.8% (2221 of 3135 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/parse/lib/parse/vehicle_positions.ex                             |50.0%     46| 100%     7|    -      0
  apps/parse/lib/parse/vehicle_positions_json.ex                        |67.9%     28| 100%     7|    -      0
  apps/state/lib/state/route.ex                                         |75.9%     29|67.3%    49|    -      0
  apps/state/lib/state/route_pattern.ex                                 | 100%     23|63.4%    41|    -      0
  apps/state/lib/state/server.ex                                        |91.1%    124|96.7%    30|    -      0
  apps/state_mediator/lib/state_mediator.ex                             |15.0%     20|16.7%     6|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator.ex               |77.3%     22|62.5%     8|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator/handler.ex       |77.8%      9|85.7%     7|    -      0

Download coverage report

@paulswartz paulswartz marked this pull request as ready for review September 27, 2023 16:33
@github-actions
Copy link

Coverage of commit c993525

Summary coverage rate:
  lines......: 89.4% (4093 of 4576 lines)
  functions..: 70.9% (2222 of 3136 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/parse/lib/parse/vehicle_positions.ex                             |50.0%     46| 100%     7|    -      0
  apps/parse/lib/parse/vehicle_positions_json.ex                        |67.9%     28| 100%     7|    -      0
  apps/state/lib/state/server.ex                                        |91.1%    124|96.7%    30|    -      0
  apps/state_mediator/lib/state_mediator.ex                             |15.0%     20|16.7%     6|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator.ex               |77.3%     22|62.5%     8|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator/handler.ex       |77.8%      9|85.7%     7|    -      0

Download coverage report

This allows us to add new environment variables for the MQTT broker,
without breaking existing API instances which expect the source to be an
HTTPS URL.
@github-actions
Copy link

Coverage of commit 6fd7c1a

Summary coverage rate:
  lines......: 89.4% (4094 of 4577 lines)
  functions..: 70.9% (2222 of 3136 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/parse/lib/parse/vehicle_positions.ex                             |50.0%     46| 100%     7|    -      0
  apps/parse/lib/parse/vehicle_positions_json.ex                        |67.9%     28| 100%     7|    -      0
  apps/state/lib/state/server.ex                                        |91.1%    124|96.7%    30|    -      0
  apps/state_mediator/lib/state_mediator.ex                             |15.0%     20|16.7%     6|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator.ex               |78.3%     23|62.5%     8|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator/handler.ex       |77.8%      9|85.7%     7|    -      0

Download coverage report

@paulswartz paulswartz temporarily deployed to dev-green October 3, 2023 13:18 — with GitHub Actions Inactive
@paulswartz paulswartz merged commit 5dcbdef into master Oct 3, 2023
7 checks passed
@paulswartz paulswartz deleted the ps-mqtt branch October 3, 2023 13:35
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Coverage of commit 20c2c7d

Summary coverage rate:
  lines......: 89.4% (4092 of 4577 lines)
  functions..: 70.9% (2222 of 3136 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/parse/lib/parse/vehicle_positions.ex                             |50.0%     46| 100%     7|    -      0
  apps/parse/lib/parse/vehicle_positions_json.ex                        |67.9%     28| 100%     7|    -      0
  apps/state/lib/state/server.ex                                        |91.1%    124|96.7%    30|    -      0
  apps/state_mediator/lib/state_mediator.ex                             |15.0%     20|16.7%     6|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator.ex               |78.3%     23|62.5%     8|    -      0
  apps/state_mediator/lib/state_mediator/mqtt_mediator/handler.ex       |77.8%      9|85.7%     7|    -      0

Download coverage report

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