We have a field in demoddata called "source" which stores the application source of the data (network, sids, manual). This causes a lot of confusion with the SiDS API format which has a "source" parameter (that we convert to "station")
As I'm working through documenting the API (and getting us ready for feature expansion), I'd like this field renamed to avoid future confusion.
Transmitter model has been refactored by changing the current schema
from Transmitter and Suggestion models to TransmitterEntry model and
two proxy models TransmitterSuggestion and Transmitter:
* TransmitterEntry model will hold all the entries and changes on
transmitter entries in db.
* TransmitterSuggestion model will be the proxy model of the unreviewed
transmitter entries.
* Transmitter model will be the proxy model of the latest approved and
reviewed transmitter entries.
There are also change on Transmitter model fields:
* alive field is now change to status field
* there are new fields: citation, user, reviewed and created
Signed-off-by: Corey Shields <cshields@gmail.com>
In django cache we are storing a full queryset of the satellites with their data count and last payload time. By trying to filter on this (sat_cache = sats_cache.filter(norad_cat_id=norad)) we cause django to re-evaluate the queries for that specific satellite. For CAS-4a this results in 2 queries that exceed 5 mins each.
This does not impact the /stats/ page as it iterates through the whole list of satellites in cache. This change mimics that behavior to find the satellite cache we care about in the template. Its a huge hack but its the only way we can show a count and bring the page view back for !237 quickly... This needs refactoring, big time..
I also pulled an unused has_telemetry_data which caused a db count
This leaves behind a query to pull the last payload to show who submitted the last payload, as without this query there is no connection between the cached satellite info and the actual observer (because the /stats/ page was not meant to make that connection). If this query continues to be prohibitive we may just need to remove the "last frame submitted by.." blob.
In this change we continue using the cache for the frame count, but instead of using the cache for the latest frame as discussed in IRC we grab the latest frame based on the ID. In my test environment this was a reasonable query time.
I'd rather we try this route before resorting to the cache for latest frame as it will be a better user experience.
Signed-off-by: Corey Shields <cshields@gmail.com>
This commit replaces the recursive 'dict' extraction functions with
'get_fields()' method which returns specific fields from Kaitai Struct
docstrings. The InfluxDB schema is also optimized to write multiple
fields per data point with the unique NORAD id used as the measurement
name.
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>