1 | /**
|
2 | * Default context for all metrics.
|
3 | * @category Metrics
|
4 | */
|
5 | import { MatrixClient } from "../MatrixClient";
|
6 | import { Intent } from "../appservice/Intent";
|
7 | export interface IMetricContext {
|
8 | /**
|
9 | * Unique identifier for the context object. Used to differentiate
|
10 | * contexts over a start/end event.
|
11 | */
|
12 | uniqueId: string;
|
13 | }
|
14 | /**
|
15 | * Metric context for function call metrics.
|
16 | * @category Metrics
|
17 | */
|
18 | export interface FunctionCallContext extends IMetricContext {
|
19 | /**
|
20 | * The function name being called
|
21 | */
|
22 | functionName: string;
|
23 | }
|
24 | /**
|
25 | * Metric context for metrics from a MatrixClient
|
26 | * @category Metrics
|
27 | */
|
28 | export interface MatrixClientCallContext extends FunctionCallContext {
|
29 | /**
|
30 | * The client that raised the metric.
|
31 | */
|
32 | client: MatrixClient;
|
33 | }
|
34 | /**
|
35 | * Metric context for metrics from an Intent
|
36 | * @category Metrics
|
37 | */
|
38 | export interface IntentCallContext extends MatrixClientCallContext {
|
39 | /**
|
40 | * The intent that is raising the metric.
|
41 | */
|
42 | intent: Intent;
|
43 | }
|