@wdio/browserstack-service
Version:
WebdriverIO service for better Browserstack integration
47 lines • 2.1 kB
TypeScript
import { PerformanceObserver } from 'node:perf_hooks';
import type { CsvWriter } from 'csv-writer/src/lib/csv-writer.js';
import type { ObjectMap } from 'csv-writer/src/lib/lang/object.js';
import type { Browser } from 'webdriverio';
type PerformanceDetails = {
success?: true;
failure?: string;
testName?: string;
worker?: string | number;
command?: string;
hookType?: string;
platform?: string | number;
};
export default class PerformanceTester {
static _observer: PerformanceObserver;
static _csvWriter: CsvWriter<ObjectMap<{}>>;
private static _events;
private static _measuredEvents;
static started: boolean;
static details: {
[key: string]: PerformanceDetails;
};
static eventsMap: {
[key: string]: number;
};
static browser?: Browser;
static scenarioThatRan: string[];
static jsonReportDirName: string;
static jsonReportDirPath: string;
static jsonReportFileName: string;
static startMonitoring(csvName?: string): void;
static calculateTimes(methods: string[]): number;
static stopAndGenerate(filename?: string): Promise<void>;
static generateReport(entries: PerformanceEntry[]): string;
static generateCSV(entries: PerformanceEntry[]): void;
static Measure(label: string, details?: PerformanceDetails): (target: object, key: string | symbol, descriptor: TypedPropertyDescriptor<Function>) => void;
static measureWrapper(name: string, fn: Function, details?: PerformanceDetails): (...args: (object | boolean | undefined | null | string)[]) => any;
static isEnabled(): boolean;
static measure(label: string, fn: Function, details?: {}, args?: (object | boolean | undefined | null | string)[], thisArg?: object | null): any;
static start(event: string): void;
static end(event: string, success?: boolean, failure?: string | unknown, details?: {}): void;
static getProcessId(): string;
static sleep: (ms?: number) => Promise<unknown>;
static uploadEventsData(): Promise<void>;
}
export {};
//# sourceMappingURL=performance-tester.d.ts.map