metrics: group the metrics when sending live stats

without this the tooltip doesn't work. it needs to have the same
consistent timestamps
This commit is contained in:
Girish Ramakrishnan
2025-07-08 16:45:55 +02:00
parent d09f932834
commit 0952b6d68f
3 changed files with 63 additions and 55 deletions
+2
View File
@@ -11,12 +11,14 @@ exports = module.exports = {
// IMPORTANT: this file is required from the migration logic. avoid requires
const assert = require('assert');
// note: returns shallow copy. use structuredClone() on top to get a deep copy
function pick(obj, keys) {
assert(Array.isArray(keys));
return Object.fromEntries(Object.entries(obj).filter(([key]) => keys.includes(key)));
}
// note: returns shallow copy. use structuredClone() on top to get a deep copy
function omit(obj, keys) {
assert(Array.isArray(keys));