Add telemetry to track execute cell from <Prompt/> (#15)

This commit is contained in:
Tanuj Mittal
2020-06-02 10:46:12 -07:00
committed by GitHub
parent a6c44e0e69
commit ab3486bd05
4 changed files with 51 additions and 7 deletions

View File

@@ -1,9 +1,10 @@
import { actions, CoreRecord, reducers as nteractReducers } from "@nteract/core";
import { Action } from "redux";
import { Areas } from "../../../Common/Constants";
import TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor";
import * as cdbActions from "./actions";
import { CdbRecord } from "./types";
import { Action } from "redux";
import { actions, CoreRecord, reducers as nteractReducers } from "@nteract/core";
export const coreReducer = (state: CoreRecord, action: Action) => {
let typedAction;
switch (action.type) {
@@ -75,6 +76,17 @@ export const cdbReducer = (state: CdbRecord, action: Action) => {
const typedAction = action as cdbActions.SetHoveredCellAction;
return state.set("hoveredCellId", typedAction.payload.cellId);
}
case cdbActions.TRACE_NOTEBOOK_TELEMETRY: {
const typedAction = action as cdbActions.TraceNotebookTelemetryAction;
TelemetryProcessor.trace(typedAction.payload.action, typedAction.payload.actionModifier, {
...typedAction.payload.data,
databaseAccountName: state.databaseAccountName,
defaultExperience: state.defaultExperience,
dataExplorerArea: Areas.Notebook
});
return state;
}
}
return state;
};