faastjs
Version:
Serverless batch computing made simple.
35 lines (34 loc) • 1.22 kB
TypeScript
/// <reference types="node" />
import { FunctionStats } from "./provider";
import { SmallestN, Statistics } from "./shared";
import { PropertiesOfType } from "./types";
export declare class FactoryMap<K = string, V = {}> extends Map<K, V> {
readonly factory: (key: K) => V;
constructor(factory: (key: K) => V);
getOrCreate(key: K): V;
}
export declare class FunctionStatsMap {
fIncremental: FactoryMap<string, FunctionStats>;
fAggregate: FactoryMap<string, FunctionStats>;
aggregate: FunctionStats;
update(fn: string, key: keyof PropertiesOfType<FunctionStats, Statistics>, value: number): void;
incr(fn: string, key: keyof PropertiesOfType<FunctionStats, number>, n?: number): void;
resetIncremental(): void;
toString(): string;
clear(): void;
}
export declare class FunctionCpuUsage {
utime: Statistics;
stime: Statistics;
cpuTime: Statistics;
smallest: SmallestN<void>;
}
export declare class MemoryLeakDetector {
private instances;
private counters;
private warned;
private memorySize;
constructor(memorySize?: number);
detectedNewLeak(fn: string, instanceId: string, memoryUsage: NodeJS.MemoryUsage): boolean;
clear(): void;
}