Refactor the list measurements function to make use of nested queries (#662)
* Refactor the list measurements function to make use of nested queries With a dataset of 1489 test, the ooniprobe list command went from taking 17.27s to run, to requiring 0.17s or a 100x speed boost See https://github.com/ooni/probe/issues/1966 * Remove dead code from actions * Improve the tests for the ListResults function * Add test for AnomalyCount * Add more documentation about the merging of the test_keys
This commit is contained in:
parent
b5da8be183
commit
a884481b12
4 changed files with 86 additions and 80 deletions
|
|
@ -11,8 +11,11 @@ import (
|
|||
// ResultNetwork is used to represent the structure made from the JOIN
|
||||
// between the results and networks tables.
|
||||
type ResultNetwork struct {
|
||||
Result `db:",inline"`
|
||||
Network `db:",inline"`
|
||||
Result `db:",inline"`
|
||||
Network `db:",inline"`
|
||||
AnomalyCount uint64 `db:"anomaly_count"`
|
||||
TotalCount uint64 `db:"total_count"`
|
||||
TestKeys string `db:"test_keys"`
|
||||
}
|
||||
|
||||
// UploadedTotalCount is the count of the measurements which have been uploaded vs the total measurements in a given result set
|
||||
|
|
|
|||
Loading…
Reference in a new issue