mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-27 12:51:41 +00:00
* initial commit for docs * Added readme * modified selfServeutil docs * updated docs * moved documentation to docs folder * Updated ReadME for selfserve * added more comments * Added more function types * Update index.html * Update index.html * minro edits * minor edits * package.json updated * Added Module decorators * Added modules * initial commit for mongo shell refactor * undid changes * addressed PR comments * docs changes * addressed PR comments * More changes * Added selfserveexample types file * minor edits * minor edits * Addressed PR comments * format changes * added Metrics blade link * documentation changes * updated docs * Addressed PR comments * fixed format error
54 lines
2.1 KiB
TypeScript
54 lines
2.1 KiB
TypeScript
/**
|
|
* @module SelfServe/SelfServeTelemetryProcessor
|
|
*/
|
|
|
|
import { SelfServeMessageTypes } from "../Contracts/SelfServeContracts";
|
|
import { Action, ActionModifiers } from "../Shared/Telemetry/TelemetryConstants";
|
|
import { trace, traceCancel, traceFailure, traceStart, traceSuccess } from "../Shared/Telemetry/TelemetryProcessor";
|
|
import { SelfServeTelemetryMessage } from "./SelfServeTypes";
|
|
|
|
/**
|
|
* Log an action.
|
|
* @param data Data to be sent as part of the Self Serve Telemetry.
|
|
*/
|
|
export const selfServeTrace = (data: SelfServeTelemetryMessage): void => {
|
|
trace(Action.SelfServe, ActionModifiers.Mark, data, SelfServeMessageTypes.TelemetryInfo);
|
|
};
|
|
|
|
/**
|
|
* Start logging an action.
|
|
* @param data Data to be sent as part of the Self Serve Telemetry.
|
|
* @returns Timestamp of the trace start, that can be used in other trace actions.
|
|
* The timestamp is used to identify all the logs associated with an action.
|
|
*/
|
|
export const selfServeTraceStart = (data: SelfServeTelemetryMessage): number => {
|
|
return traceStart(Action.SelfServe, data, SelfServeMessageTypes.TelemetryInfo);
|
|
};
|
|
|
|
/**
|
|
* Log an action as a success.
|
|
* @param data Data to be sent as part of the Self Serve Telemetry.
|
|
* @param timestamp Timestamp of the action's start trace.
|
|
*/
|
|
export const selfServeTraceSuccess = (data: SelfServeTelemetryMessage, timestamp?: number): void => {
|
|
traceSuccess(Action.SelfServe, data, timestamp, SelfServeMessageTypes.TelemetryInfo);
|
|
};
|
|
|
|
/**
|
|
* Log an action as a failure.
|
|
* @param data Data to be sent as part of the Self Serve Telemetry.
|
|
* @param timestamp Timestamp of the action's start trace.
|
|
*/
|
|
export const selfServeTraceFailure = (data: SelfServeTelemetryMessage, timestamp?: number): void => {
|
|
traceFailure(Action.SelfServe, data, timestamp, SelfServeMessageTypes.TelemetryInfo);
|
|
};
|
|
|
|
/**
|
|
* Log an action as cancelled.
|
|
* @param data Data to be sent as part of the Self Serve Telemetry.
|
|
* @param timestamp Timestamp of the action's start trace.
|
|
*/
|
|
export const selfServeTraceCancel = (data: SelfServeTelemetryMessage, timestamp?: number): void => {
|
|
traceCancel(Action.SelfServe, data, timestamp, SelfServeMessageTypes.TelemetryInfo);
|
|
};
|