UNPKG

@acromedia/sloth

Version:

Resource profiler for node, utilizing child processes

41 lines (40 loc) 1.13 kB
export default class ProfileResults { data: ResultData; /** * Wraps the results of the Profiler into a class. * * Makes it easy to implement functions that * interact with the data. * * It is also helpful for providing useful jsdoc * definitions for the properties of the data. */ constructor(data: ResultData | null); /** * Get average memory usage. */ averageMemoryUsage(): number; /** * Get median memory usage. */ medianMemoryUsage(): number; /** * Get most frequently occuring value in memory usage. */ modeMemoryUsage(): number; /** * Get the amount of memory taken up at a certain point within the test. * * @param {Number} ms */ memoryAtElapsed(ms: number): number; /** * Save data as a snapshot for comparison in future tests. */ saveSnapshot(filename: string, path?: string): void | Record<string, unknown>; compareToSnapshot(path: string, options?: { logResultsDiff?: boolean; graph?: string; graph_path?: string; }): Comparison | null; }