Open hellais opened 7 months ago
So I was looking into this and thinking about this in the context of also improving how the lookup works in the network and domain pages.
From the looks of it, we basically have 4 bits of information that we need for a particular country, network or domain:
The first 3 items, we have to load once upon first render, while for 4. we will have to make a new fetch every time the user clicks on a different calendar year.
At the moment in the network pages we are doing this in a way that's a bit suboptimal, in that we load on first render the whole aggregation result since 12 years before the current date: https://github.com/ooni/explorer/blob/master/pages/as/%5Bprobe_asn%5D.js#L221.
This is problematic for 2 reasons:
My proposal is therefore that we implement 1 new endpoint and discontinue the existing test_coverage
and country_overview
endpoints that returns:
We can call it measurement_overview
and have it take as parameters probe_cc
, probe_asn
, test_name
, domain
and it returns: total_measurements
, first_measurement_date
, last_measurement_date
.
For the counts per year, we can continue using the aggregation endpoint, since it already supports fetching data one year at a time.
@majakomel how does this sound?
/api/_/test_coverage
/api/_/country_overview
While we are at it, we only every need to fetch data one year at a time to so we should be able to add constraints about that to it.