Skip to content

Commit 6d37917

Browse files
committed
feat(telemetry): track total node count
1 parent b423d62 commit 6d37917

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ export class MixpanelTelemetryProvider implements TelemetryProvider {
169169
const runButtonProperties: RunButtonProperties = {
170170
subscribe_to_run: options?.subscribe_to_run || false,
171171
workflow_type: executionContext.is_template ? 'template' : 'custom',
172-
workflow_name: executionContext.workflow_name ?? 'untitled'
172+
workflow_name: executionContext.workflow_name ?? 'untitled',
173+
total_node_count: executionContext.total_node_count
173174
}
174175

175176
this.trackEvent(TelemetryEvents.RUN_BUTTON_CLICKED, runButtonProperties)
@@ -283,10 +284,16 @@ export class MixpanelTelemetryProvider implements TelemetryProvider {
283284
return {
284285
custom_node_count: acc.custom_node_count + (isCustomNode ? 1 : 0),
285286
api_node_count: acc.api_node_count + (isApiNode ? 1 : 0),
286-
subgraph_count: acc.subgraph_count + (isSubgraph ? 1 : 0)
287+
subgraph_count: acc.subgraph_count + (isSubgraph ? 1 : 0),
288+
total_node_count: acc.total_node_count + 1
287289
}
288290
},
289-
{ custom_node_count: 0, api_node_count: 0, subgraph_count: 0 }
291+
{
292+
custom_node_count: 0,
293+
api_node_count: 0,
294+
subgraph_count: 0,
295+
total_node_count: 0
296+
}
290297
)
291298

292299
if (activeWorkflow?.filename) {

src/platform/telemetry/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface RunButtonProperties {
4242
subscribe_to_run: boolean
4343
workflow_type: 'template' | 'custom'
4444
workflow_name: string
45+
total_node_count: number
4546
}
4647

4748
/**
@@ -61,6 +62,7 @@ export interface ExecutionContext {
6162
custom_node_count: number
6263
api_node_count: number
6364
subgraph_count: number
65+
total_node_count: number
6466
}
6567

6668
/**

0 commit comments

Comments
 (0)