UNPKG

@wdio/browserstack-service

Version:
58 lines 2.54 kB
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; clientWorkerId?: string; command?: string; hookType?: string; platform?: string | number; }; export default class PerformanceTester { static _observer: PerformanceObserver; static _csvWriter: CsvWriter<ObjectMap<{}>>; private static _events; private static _measuredEvents; private static _hasStoppedGeneration; private static _stopGenerateCallCount; 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; /** * Get client worker ID in format "threadId-processId". * This method provides a consistent identifier across the SDK for tracking * worker-specific events and performance metrics. * * @returns Worker ID string in format "threadId-processId" */ static getClientWorkerId(): string; static getProcessId(): string; static sleep: (ms?: number) => Promise<unknown>; static uploadEventsData(): Promise<void>; } export {}; //# sourceMappingURL=performance-tester.d.ts.map