(core) Add new telemetry events

Summary: Adds a handful of new telemetry events, and makes a few tweaks to allow for better organization of telemetry.

Test Plan: Manual.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D4100
This commit is contained in:
George Gevoian
2023-11-01 09:54:19 -04:00
parent 51f7402297
commit 7a85aaa7a1
19 changed files with 523 additions and 129 deletions

View File

@@ -172,9 +172,16 @@ export class FormulaAssistant extends Disposable {
this._triggerFinalize = bundleInfo.triggerFinalize;
this.onDispose(() => {
if (this._hasExpandedOnce) {
const suggestionApplied = this._chat.conversationSuggestedFormulas.get()
.includes(this._options.column.formula.peek());
if (suggestionApplied) {
this._logTelemetryEvent('assistantApplySuggestion', false, {
conversationLength: this._chat.conversationLength.get(),
conversationHistoryLength: this._chat.conversationHistoryLength.get(),
});
}
this._logTelemetryEvent('assistantClose', false, {
suggestionApplied: this._chat.conversationSuggestedFormulas.get()
.includes(this._options.column.formula.peek()),
suggestionApplied,
conversationLength: this._chat.conversationLength.get(),
conversationHistoryLength: this._chat.conversationHistoryLength.get(),
});
@@ -400,7 +407,9 @@ export class FormulaAssistant extends Disposable {
*/
private _cancel() {
if (this._hasExpandedOnce) {
this._logTelemetryEvent('assistantCancel', true);
this._logTelemetryEvent('assistantCancel', true, {
conversationLength: this._chat.conversationLength.get(),
});
}
this._action = 'cancel';
this._triggerFinalize();