0.0.8 • Published 3 years ago

js-apm v0.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

Build Status

Performance monitoring for web app

get profile data from client

Installation

npm i js-apm

or bundled:

<script src="dist/bundle/js-apm.js"></script>

will expose global Apm constuctor

Usage

import Apm from "js-apm";

const apm = new Apm(window);
const data = apm.getGeneralInfo();

where data is:

export default class GeneralInfo {
    userAgent: string;
    connection?: Connection;
    timing?: Timing;
}

declare class Connection {
    type?: "bluetooth" | "none" | "unknown" | "cellular" | "ethernet" | "mixed" | "other" | "wifi" | "wimax" | undefined;
    effectiveType?: "2g" | "3g" | "4g" | "slow-2g" | undefined;
    downlinkMax?: number | undefined;
    downlink?: number | undefined;
    rtt?: number | undefined;
    saveData?: boolean | undefined;
}

declare class Timing {
    domComplete: bigint;
    domContentLoadedEventEnd: bigint;
    domContentLoadedEventStart: bigint;
    domInteractive: bigint;
    loadEventEnd: bigint;
    loadEventStart: bigint;
    redirectCount: bigint;
    unloadEventEnd: bigint;
    unloadEventStart: bigint;
}

Connection is serializable version of NetworkInformation
And Timing is like PerformanceNavigationTiming, but with integer values for sake of serialization

0.0.8

3 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago