mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-29 00:47:01 +00:00
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 { sendMessage } from "../Common/MessageHandler";
|
||||||
import { SelfServeMessageTypes } from "../Contracts/SelfServeContracts";
|
import { SelfServeMessageTypes } from "../Contracts/SelfServeContracts";
|
||||||
import { SmartUiComponent, SmartUiDescriptor } from "../Explorer/Controls/SmartUi/SmartUiComponent";
|
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 { commandBarItemStyles, commandBarStyles, containerStackTokens, separatorStyles } from "./SelfServeStyles";
|
||||||
import {
|
import {
|
||||||
AnyDisplay,
|
AnyDisplay,
|
||||||
@ -27,6 +29,7 @@ import {
|
|||||||
Node,
|
Node,
|
||||||
NumberInput,
|
NumberInput,
|
||||||
RefreshResult,
|
RefreshResult,
|
||||||
|
SelfServeComponentTelemetryType,
|
||||||
SelfServeDescriptor,
|
SelfServeDescriptor,
|
||||||
SmartUiInput,
|
SmartUiInput,
|
||||||
StringInput,
|
StringInput,
|
||||||
@ -87,6 +90,12 @@ export class SelfServeComponent extends React.Component<SelfServeComponentProps,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.initializeSmartUiComponent();
|
this.initializeSmartUiComponent();
|
||||||
|
|
||||||
|
const telemetryData = {
|
||||||
|
selfServeClassName: this.props.descriptor.root.id,
|
||||||
|
eventType: SelfServeComponentTelemetryType.Load,
|
||||||
|
};
|
||||||
|
trace(Action.SelfServeComponent, ActionModifiers.Mark, telemetryData, SelfServeMessageTypes.TelemetryInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props: SelfServeComponentProps) {
|
constructor(props: SelfServeComponentProps) {
|
||||||
@ -262,6 +271,12 @@ export class SelfServeComponent extends React.Component<SelfServeComponentProps,
|
|||||||
};
|
};
|
||||||
|
|
||||||
public performSave = async (): Promise<void> => {
|
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 });
|
this.setState({ isSaving: true, notification: undefined });
|
||||||
try {
|
try {
|
||||||
const onSaveResult = await this.props.descriptor.onSave(
|
const onSaveResult = await this.props.descriptor.onSave(
|
||||||
|
@ -70,6 +70,12 @@ export interface SelfServeDescriptor {
|
|||||||
refreshParams?: RefreshParams;
|
refreshParams?: RefreshParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**@internal */
|
||||||
|
export enum SelfServeComponentTelemetryType {
|
||||||
|
Load = "Load",
|
||||||
|
Save = "Save",
|
||||||
|
}
|
||||||
|
|
||||||
/**@internal */
|
/**@internal */
|
||||||
export type AnyDisplay = NumberInput | BooleanInput | StringInput | ChoiceInput | DescriptionDisplay;
|
export type AnyDisplay = NumberInput | BooleanInput | StringInput | ChoiceInput | DescriptionDisplay;
|
||||||
|
|
||||||
|
@ -117,6 +117,7 @@ export enum Action {
|
|||||||
SelfServe,
|
SelfServe,
|
||||||
ExpandAddCollectionPaneAdvancedSection,
|
ExpandAddCollectionPaneAdvancedSection,
|
||||||
SchemaAnalyzerClickAnalyze,
|
SchemaAnalyzerClickAnalyze,
|
||||||
|
SelfServeComponent,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ActionModifiers = {
|
export const ActionModifiers = {
|
||||||
|
Loading…
Reference in New Issue
Block a user