/** * Telemetry * record execution time and behavior by tagging class methods * Usage: * ``` * import { of } from 'rxjs'; * class Client { * // track execution time only * @Record() * calculate() {} * * // async observables * @Record() * connect() {return of(10).delay(1);} * * // Record function arguments and return value * @Record({args: true, returnValue: true}) * add(a, b) {return a+b;} * * // returnValue works asynchronously too * @Record({returnValue: true}) * addAsync(a, b) {return of(a+b);} * } * ``` */ /** mutate this object to change global settings */ export declare const GlobalOptions: { enabled: boolean; defaultRecordOptions: Record.Options; }; /** Describes one function call */ export interface Reading { /** milliseconds from invocation until completion * if the function returned an observable, time until an event is observed */ duration: number; /** milliseconds between invocation and function return */ syncDuration: number; /** semantic tags can be used to annotate and group recorings */ tags: string[]; /** arguments passed to the fuunction call */ args?: any[]; /** if the function returned an observable, the first event observed (non-recursive) */ returnValue?: any; } /** Class method decorator, records execution time */ declare function Record(options?: Partial): (proto: any, propertyKey: string, descriptor: any) => any; declare namespace Record { interface Options { args: boolean; returnValue: boolean; name?: string; tags?: string[]; recordFunc: (name: string, reading: Reading) => void; } } export { Record };