Sort indexer queries stats by a sum of all 3 types

This commit is contained in:
Bogdan
2024-07-26 00:51:51 +03:00
parent 4c99971882
commit 5464b23329
2 changed files with 10 additions and 4 deletions
+6 -4
View File
@@ -73,10 +73,12 @@ function getFailureRateData(indexerStats: IndexerStatsIndexer[]) {
}
function getTotalRequestsData(indexerStats: IndexerStatsIndexer[]) {
const statistics = [...indexerStats].sort((a, b) =>
a.numberOfQueries === b.numberOfQueries
? b.numberOfRssQueries - a.numberOfRssQueries
: b.numberOfQueries - a.numberOfQueries
const statistics = [...indexerStats].sort(
(a, b) =>
b.numberOfQueries +
b.numberOfRssQueries +
b.numberOfAuthQueries -
(a.numberOfQueries + a.numberOfRssQueries + a.numberOfAuthQueries)
);
return {