BREAKING CHANGE(core): switch to esm
This commit is contained in:
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartmetrics',
|
||||
version: '2.0.0',
|
||||
description: 'easy system metrics'
|
||||
}
|
@ -1,2 +1,2 @@
|
||||
export * from './smartmetrics.interfaces';
|
||||
export * from './smartmetrics.classes.smartmetrics';
|
||||
export * from './smartmetrics.interfaces.js';
|
||||
export * from './smartmetrics.classes.smartmetrics.js';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as plugins from './smartmetrics.plugins';
|
||||
import * as interfaces from './smartmetrics.interfaces';
|
||||
import * as plugins from './smartmetrics.plugins.js';
|
||||
import * as interfaces from './smartmetrics.interfaces.js';
|
||||
|
||||
export class SmartMetrics {
|
||||
public started = false;
|
||||
@ -68,7 +68,9 @@ export class SmartMetrics {
|
||||
memoryUsageBytes += stats[stat].memory;
|
||||
}
|
||||
let memoryPercentage = Math.round((memoryUsageBytes / 1000000000) * 100 * 100) / 100;
|
||||
let memoryUsageText = `${memoryPercentage}% | ${this.formatBytes(memoryUsageBytes)} / ${this.formatBytes(1000000000)}`;
|
||||
let memoryUsageText = `${memoryPercentage}% | ${this.formatBytes(
|
||||
memoryUsageBytes
|
||||
)} / ${this.formatBytes(1000000000)}`;
|
||||
|
||||
console.log(`${cpuUsageText} ||| ${memoryUsageText} `);
|
||||
|
||||
|
@ -9,4 +9,4 @@ export interface IMetricsSnapshot {
|
||||
memoryPercentage: number;
|
||||
memoryUsageBytes: number;
|
||||
memoryUsageText: string;
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +1,17 @@
|
||||
// node native
|
||||
import * as os from 'os';
|
||||
|
||||
export {
|
||||
os
|
||||
}
|
||||
export { os };
|
||||
|
||||
// pushrocks scope
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
import * as smartlog from '@pushrocks/smartlog';
|
||||
|
||||
export {
|
||||
smartdelay,
|
||||
smartlog
|
||||
}
|
||||
export { smartdelay, smartlog };
|
||||
|
||||
// third party scope
|
||||
import pidusage from 'pidusage';
|
||||
import pidtree from 'pidtree';
|
||||
import * as promClient from 'prom-client';
|
||||
|
||||
export {
|
||||
pidusage,
|
||||
pidtree,
|
||||
promClient
|
||||
}
|
||||
export { pidusage, pidtree, promClient };
|
||||
|
Reference in New Issue
Block a user