-
Notifications
You must be signed in to change notification settings - Fork 239
/
IPerfManager.ts
53 lines (47 loc) · 1.71 KB
/
IPerfManager.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { IPerfEvent } from "./../JavaScriptSDK.Interfaces/IPerfEvent";
/**
* Identifies an interface to a host that can provide an IPerfManager implementation
*/
export interface IPerfManagerProvider {
/**
* Get the current performance manager
*/
getPerfMgr(): IPerfManager;
/**
* Set the current performance manager
* @param perfMgr - The performance manager
*/
setPerfMgr(perfMgr: IPerfManager): void;
}
/**
* This defines an internal performance manager for tracking and reporting the internal performance of the SDK -- It does
* not represent or report any event to the server.
*/
export interface IPerfManager {
/**
* Create a new event and start timing, the manager may return null/undefined to indicate that it does not
* want to monitor this source event.
* @param src - The source name of the event
* @param payloadDetails - An optional callback function to fetch the payload details for the event.
* @param isAsync - Is the event occurring from a async event
*/
create(src: string, payloadDetails?: () => any, isAsync?: boolean): IPerfEvent | null | undefined;
/**
* Complete the perfEvent and fire any notifications.
* @param perfEvent - Fire the event which will also complete the passed event
*/
fire(perfEvent: IPerfEvent): void;
/**
* Set an execution context value
* @param key - The context key name
* @param value - The value
*/
setCtx(key: string, value: any): void;
/**
* Get the execution context value
* @param key - The context key
*/
getCtx(key: string): any;
}