npm.io
0.3.6 • Published 2 years ago

@types/memwatch-next

Licence
MIT
Version
0.3.6
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/memwatch-next

Summary

This package contains type definitions for memwatch-next (https://github.com/marcominetti/node-memwatch).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/memwatch-next.

index.d.ts

declare module "memwatch-next" {
    type EventCallback = (data: LeakInformation | StatsInformation | Object) => void;

    /**
     * Compare the state of your heap between two points in time, telling you what has been allocated, and what has been released.
     */
    export class HeapDiff {
        /**
         * Compute the diff.
         */
        end: () => void;
    }

    /**
     * Stats information.
     * @interface
     */
    export interface StatsInformation {
        current_base: number;
        estimated_base: number;
        heap_compactions: number;
        max: number;
        min: number;
        num_full_gc: number;
        num_inc_gc: number;
        usage_trend: number;
    }

    /**
     * Leak information.
     * @interface
     */
    export interface LeakInformation {
        /**
         * End date.
         */
        end: Date;

        /**
         * Growth.
         */
        growth: number;

        /**
         * Reason leak.
         */
        reason: string;

        /**
         * Start date.
         */
        start: Date;
    }

    /**
     * Subscribe to a event.
     * @param {string} eventName A event name.
     * @param {EventCallback} callback A callback;
     */
    export function on(eventName: string, callback: EventCallback): void;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: none

Credits

These definitions were written by Cyril Schumacher.