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

Reliability (Get and Report Bus Fullness) #344

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

nfq2
Copy link

@nfq2 nfq2 commented Nov 12, 2024

Overview

Implement two routes, getBusFullness and reportBusFullness. getBusFullness return the fullness of a requested trip ID and the minutes elapsed since a fullness was last reported. reportBusFullness adds a new report (tripId, time, and fullness) to the database. All data is currently stored in a JSON file called busFullness.json at the root of the directory.

tripId: route number
time: unix time
fullness: integer value

Changes Made

GetFullnessRouter.js: Implement getBusFullness route
ReportFullnessRouter.js: Implement reportBusFullness route
ReliabilityUtils.js: Implement helper functions for getBusFullness and reportBusFullness

Test Coverage

Get bus fullness:
image

Returns NULL when no reports exist for tripId
image

Report bus fullness
image
image

Next Steps

Currently fullness is stored as an integer, but we're still waiting on design for what they want reliability to look like and how fullness is measured. The reports are stored in a JSON for now, but we plan to eventually store them in a MongoDB database.

Related PRs or Issues

Copy link
Contributor

@cindy-x-liang cindy-x-liang left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

@Aayush-Agnihotri Aayush-Agnihotri left a comment

Choose a reason for hiding this comment

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

LGTM

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