Git Product home page Git Product logo

prosperapi's Issues

end-to-end ujson integration

Improve performance by making sure ujson is integrated everywhere in the stack it should be.

  • incoming requests
  • tinydb connections
  • pandas to_json
    • pandas.io.json.dumps = ujson.dumps
    • pandas.io.json.loads = usjon.loads + precise_float=True in pd.read_json() args
  • skip Flask.jsonify by building response directly from pandas

Add retry to ESI calls

ESI calls are failing ~1%. Add retry

[ERROR:crest_utils.py--fetch_market_history:354]
ERROR: unable to fetch market history from CREST
    type_id: 39
    region_id: 10000002
Traceback (most recent call last):
  File "/opt/venvs/prosper-api/lib/python3.5/site-packages/publicAPI/crest_utils.py", line 343, in fetch_market_history
    config=config
  File "/opt/venvs/prosper-api/lib/python3.5/site-packages/publicAPI/crest_utils.py", line 303, in fetch_esi_endpoint
    req.raise_for_status()
  File "/opt/venvs/prosper-api/lib/python3.5/site-packages/requests/models.py", line 909, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://esi.tech.ccp.is/latest/markets/10000002/history/?datasource=tranquility&type_id=39
[ERROR:forecast_utils.py--fetch_extended_history:201]
ERROR: trouble getting data from CREST
    region_id=10000002
    type_id=39
Traceback (most recent call last):
  File "/opt/venvs/prosper-api/lib/python3.5/site-packages/publicAPI/crest_utils.py", line 343, in fetch_market_history
    config=config
  File "/opt/venvs/prosper-api/lib/python3.5/site-packages/publicAPI/crest_utils.py", line 303, in fetch_esi_endpoint
    req.raise_for_status()
  File "/opt/venvs/prosper-api/lib/python3.5/site-packages/requests/models.py", line 909, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://esi.tech.ccp.is/latest/markets/10000002/history/?datasource=tranquility&type_id=39

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/venvs/prosper-api/lib/python3.5/site-packages/publicAPI/forecast_utils.py", line 194, in fetch_extended_history
    logger=logger
  File "/opt/venvs/prosper-api/lib/python3.5/site-packages/publicAPI/crest_utils.py", line 361, in fetch_market_history
    mode.name
publicAPI.exceptions.CRESTBadMarketData```

Move __version__ into library

All deployed apps should report their version. Move version into publicAPI/_version.py and add a /CREST/info/version REST endpoint to check it

Add tinydb records on endpoint access

Right after logger.info() at the start of each get(), a record should be saved of the following:

  • Which endpoint was requested
  • Time requested
  • args of request

This should be saved somewhere other than cache to avoid steamrolling when installing. /var/ or /opt/ might be the place. In testmode, could save to ROOT level of project. Add path to app.cfg

sphinx integration

Be able to roll readthedocs.org docs for project. Also, allow for test failure if docstrings aren't acceptable

Better HTTP error capture

Though we are covered for exceptions with req.raise_for_status() we are not capturing all the error information.

  • Add header/req.text capture to log messages
    • Be careful of 1000 char limit on WebHook log messages
  • Fix double-counted HTTP exceptions spamming discord

PLEX Split compatability

PLEX 29668 is splitting on May 9th

Database will need to backfill the split, and handle the type conversion across split-date.

Expected behavior

  • typeid=29668: newplex * 500
  • typeid=44992: oldplex / 500

ProsperCommon v0.3.x integration

Config/Logger utilities were overhauled in v0.2.x to v0.3.x. Need to upgrade/update calls to config and how logger is created

Mongo/TinyMongo Integration

For parallel containers, a shared cache is desired.

  • Switch all TinyDB connections to tinymongo ones
  • Add pymongo connection
  • Default to tiny if/when db connection fails

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.