GithubHelp home page GithubHelp logo

codeforpdx / opentransit-collector Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 218 KB

Fetches transit data (realtime vehicle locations) and saves it to S3

License: Apache License 2.0

JavaScript 97.07% Dockerfile 2.93%

opentransit-collector's People

Contributors

eddyionescu avatar liamphmurphy avatar oliveratutexas avatar sidetrackedmind avatar youngj avatar

Stargazers

 avatar

Watchers

 avatar  avatar

opentransit-collector's Issues

S3 key paths should have leading zeros

Currently the S3 keys created by Orion do not have leading zeros in the components with 2 digit numbers like dates and months, so an alphabetic sort of the S3 keys doesn't necessarily put them in the correct order. It would be better to add leading zeros to all path components. This would also require changing opentransit-state-api accordingly.

build error handling for collector

Issue

Last week, when the streetcar provider got an error it blocked the other provider, trimet, from getting data and putting it in s3.

Proposed fix

I propose two improvements:

  1. better error handling / logging in the nextbus provider script
  2. separating the provider calls so that they can fail independently

1. better error handling / logging in the nextbus provider script

See code here for Portland's streetcar provider nextbus - https://github.com/codeforpdx/opentransit-collector/blob/master/src/providers/nextbus.js. We could build in some error handling to try/except flow and log errors. Logging errors would be helpful to aid in bug fixing. Right now, the errors go to the console. If you miss it, it can be hard to recreate.

2. separating the provider calls so that they can fail independently

We could add better error handling to the index.js file https://github.com/codeforpdx/opentransit-collector/blob/master/src/index.js. When the streetcar (nextbus) provider was broken, it was blocking the trimet gtfs-realtime collector from working. Ideally, each provider could fail independently.

resilience to "bad json" errors

Problem

Trimet's API response can have "bad json" (i.e. json-like string that breaks a parser). This will break the line

const feed = JSON.parse(body);

Goals

  • Primary - Make sure that the collector-dev docker stays alive when it encounters "bad json".
  • Nice to have - Capture timestamp and bad json string if possible for future reporting to Trimet?

Issue with portland-sc (streetcar) feed

There was an issue with the gtfs-rt feed for the street car so I removed it from the opentransit-collector process. I removed it from the process so that we would still get data from the trimet feed.

Someone can try to recreate the error locally.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.