Display grabs, failures and queries stats with values

pull/2209/head
Bogdan 5 months ago
parent 58ae9c0a13
commit ab043e87dc

@ -54,18 +54,20 @@ function getAverageResponseTimeData(indexerStats: IndexerStatsIndexer[]) {
} }
function getFailureRateData(indexerStats: IndexerStatsIndexer[]) { function getFailureRateData(indexerStats: IndexerStatsIndexer[]) {
const data = indexerStats.map((indexer) => ({ const data = [...indexerStats]
label: indexer.indexerName, .map((indexer) => ({
value: label: indexer.indexerName,
(indexer.numberOfFailedQueries + value:
indexer.numberOfFailedRssQueries + (indexer.numberOfFailedQueries +
indexer.numberOfFailedAuthQueries + indexer.numberOfFailedRssQueries +
indexer.numberOfFailedGrabs) / indexer.numberOfFailedAuthQueries +
(indexer.numberOfQueries + indexer.numberOfFailedGrabs) /
indexer.numberOfRssQueries + (indexer.numberOfQueries +
indexer.numberOfAuthQueries + indexer.numberOfRssQueries +
indexer.numberOfGrabs), indexer.numberOfAuthQueries +
})); indexer.numberOfGrabs),
}))
.filter((s) => s.value > 0);
data.sort((a, b) => b.value - a.value); data.sort((a, b) => b.value - a.value);
@ -73,13 +75,20 @@ function getFailureRateData(indexerStats: IndexerStatsIndexer[]) {
} }
function getTotalRequestsData(indexerStats: IndexerStatsIndexer[]) { function getTotalRequestsData(indexerStats: IndexerStatsIndexer[]) {
const statistics = [...indexerStats].sort( const statistics = [...indexerStats]
(a, b) => .filter(
b.numberOfQueries + (s) =>
b.numberOfRssQueries + s.numberOfQueries > 0 ||
b.numberOfAuthQueries - s.numberOfRssQueries > 0 ||
(a.numberOfQueries + a.numberOfRssQueries + a.numberOfAuthQueries) s.numberOfAuthQueries > 0
); )
.sort(
(a, b) =>
b.numberOfQueries +
b.numberOfRssQueries +
b.numberOfAuthQueries -
(a.numberOfQueries + a.numberOfRssQueries + a.numberOfAuthQueries)
);
return { return {
labels: statistics.map((indexer) => indexer.indexerName), labels: statistics.map((indexer) => indexer.indexerName),
@ -101,10 +110,12 @@ function getTotalRequestsData(indexerStats: IndexerStatsIndexer[]) {
} }
function getNumberGrabsData(indexerStats: IndexerStatsIndexer[]) { function getNumberGrabsData(indexerStats: IndexerStatsIndexer[]) {
const data = indexerStats.map((indexer) => ({ const data = [...indexerStats]
label: indexer.indexerName, .map((indexer) => ({
value: indexer.numberOfGrabs - indexer.numberOfFailedGrabs, label: indexer.indexerName,
})); value: indexer.numberOfGrabs - indexer.numberOfFailedGrabs,
}))
.filter((s) => s.value > 0);
data.sort((a, b) => b.value - a.value); data.sort((a, b) => b.value - a.value);

Loading…
Cancel
Save