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:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user