mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-06 10:27:28 -08:00
12 lines
360 B
TypeScript
12 lines
360 B
TypeScript
|
export function averageWorkerLoadFromLoads(loads: number[]): number {
|
||
|
return loads.reduce((prev, curr) => prev + curr, 0) / loads.length;
|
||
|
}
|
||
|
|
||
|
export function averageWorkerLoadFromLoadsAsString(loads: number[]): string {
|
||
|
return averageWorkerLoadFromLoads(loads).toFixed(2);
|
||
|
}
|
||
|
|
||
|
export function memAsGb(mem: number): number {
|
||
|
return mem / 1024 / 1024 / 1024;
|
||
|
}
|