Performance: reduce json data transformations (#7175)

This commit is contained in:
shamoon
2026-09-23 15:32:30 -07:00
committed by GitHub
parent a7a4378a40
commit db480ca991
8 changed files with 85 additions and 25 deletions
+7 -4
View File
@@ -8,10 +8,13 @@ const widget = {
mappings: {
workers: {
endpoint: "workers/status",
map: (data) => ({
total_workers: asJson(data).workers_status.length,
active_workers: asJson(data).workers_status.filter((worker) => !worker.idle).length,
}),
map: (data) => {
const workers = asJson(data).workers_status;
return {
total_workers: workers.length,
active_workers: workers.filter((worker) => !worker.idle).length,
};
},
},
pending: {
method: "POST",