KarrLab / datanator_rest_api

A OAS3 compliant REST API for the Datanator integrated database
MIT License
0 stars 3 forks source link

Get number of SABIO-RK K_i intermittently fails #102

Closed jonrkarr closed 4 years ago

jonrkarr commented 4 years ago

This endpoint fails: https://testapi.datanator.info/reactions/summary/get_sabio_obs/?parameter=k_is

One potential simiplification. The stats page isn't currently showing individual types of reaction constants, just the total. As a result, if its simpler, we could have 1 endpoint that returns that total number of K_cats + K_ms + K_is rather than executing the following three REST calls:

lzy7071 commented 4 years ago

The endpoint now behaves as such: https://testapi.datanator.info/reactions/summary/get_sabio_obs/?parameter={} returns the sum of k_cats, k_ms, and k_is regardless of the parameter given. In the future when MongoDB hosts get upgraded, we can switch back to dynamically generating observation counts for different parameters.

jonrkarr commented 4 years ago

It seems to still be returning the individual sums.

Is there a mechanism to cache these stats queries so they return more quickly?

lzy7071 commented 4 years ago

It seems to still be returning the individual sums.

Is there a mechanism to cache these stats queries so they return more quickly?

I think it was still getting deployed just a few minutes ago. It finished deploying just now. MongoDB does have an automatic cache mechanism, but the memory size for our host is pretty low.

jonrkarr commented 4 years ago

It is possible to cache just specific endpoints?

lzy7071 commented 4 years ago

I'll look into https://flask-caching.readthedocs.io/en/latest/

jonrkarr commented 4 years ago

Flask caching should allow you to just cache a few endpoints (the stats endpoints which are long and no arguments or arguments with a small set of possible values).