Added self serve component telemetry (#820)
This commit is contained in:
parent
2fda881770
commit
eae5b2219e
|
@ -17,6 +17,8 @@ import * as _ from "underscore";
|
|||
import { sendMessage } from "../Common/MessageHandler";
|
||||
import { SelfServeMessageTypes } from "../Contracts/SelfServeContracts";
|
||||
import { SmartUiComponent, SmartUiDescriptor } from "../Explorer/Controls/SmartUi/SmartUiComponent";
|
||||
import { Action, ActionModifiers } from "../Shared/Telemetry/TelemetryConstants";
|
||||
import { trace } from "../Shared/Telemetry/TelemetryProcessor";
|
||||
import { commandBarItemStyles, commandBarStyles, containerStackTokens, separatorStyles } from "./SelfServeStyles";
|
||||
import {
|
||||
AnyDisplay,
|
||||
|
@ -27,6 +29,7 @@ import {
|
|||
Node,
|
||||
NumberInput,
|
||||
RefreshResult,
|
||||
SelfServeComponentTelemetryType,
|
||||
SelfServeDescriptor,
|
||||
SmartUiInput,
|
||||
StringInput,
|
||||
|
@ -87,6 +90,12 @@ export class SelfServeComponent extends React.Component<SelfServeComponentProps,
|
|||
}
|
||||
});
|
||||
this.initializeSmartUiComponent();
|
||||
|
||||
const telemetryData = {
|
||||
selfServeClassName: this.props.descriptor.root.id,
|
||||
eventType: SelfServeComponentTelemetryType.Load,
|
||||
};
|
||||
trace(Action.SelfServeComponent, ActionModifiers.Mark, telemetryData, SelfServeMessageTypes.TelemetryInfo);
|
||||
}
|
||||
|
||||
constructor(props: SelfServeComponentProps) {
|
||||
|
@ -262,6 +271,12 @@ export class SelfServeComponent extends React.Component<SelfServeComponentProps,
|
|||
};
|
||||
|
||||
public performSave = async (): Promise<void> => {
|
||||
const telemetryData = {
|
||||
selfServeClassName: this.props.descriptor.root.id,
|
||||
eventType: SelfServeComponentTelemetryType.Save,
|
||||
};
|
||||
trace(Action.SelfServeComponent, ActionModifiers.Mark, telemetryData, SelfServeMessageTypes.TelemetryInfo);
|
||||
|
||||
this.setState({ isSaving: true, notification: undefined });
|
||||
try {
|
||||
const onSaveResult = await this.props.descriptor.onSave(
|
||||
|
|
|
@ -70,6 +70,12 @@ export interface SelfServeDescriptor {
|
|||
refreshParams?: RefreshParams;
|
||||
}
|
||||
|
||||
/**@internal */
|
||||
export enum SelfServeComponentTelemetryType {
|
||||
Load = "Load",
|
||||
Save = "Save",
|
||||
}
|
||||
|
||||
/**@internal */
|
||||
export type AnyDisplay = NumberInput | BooleanInput | StringInput | ChoiceInput | DescriptionDisplay;
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@ export enum Action {
|
|||
SelfServe,
|
||||
ExpandAddCollectionPaneAdvancedSection,
|
||||
SchemaAnalyzerClickAnalyze,
|
||||
SelfServeComponent,
|
||||
}
|
||||
|
||||
export const ActionModifiers = {
|
||||
|
|
Loading…
Reference in New Issue