Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-7403: Add analytics to measure graph execution time #15902

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/DynamoCore/Scheduler/AsyncTask.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Dynamo.Logging;
using System;
using System.Collections.Generic;

namespace Dynamo.Scheduler
Expand Down Expand Up @@ -195,6 +196,9 @@ internal bool Execute()
finally
{
ExecutionEndTime = scheduler.NextTimeStamp;

var elapsedTime = new TimeSpan(ExecutionEndTime.TickCount - ExecutionStartTime.TickCount);
Analytics.TrackTimedEvent(Categories.Performance, Actions.UpdateGraphAsyncTask.ToString(), elapsedTime, "Dynamo graph execution time");
}
Copy link
Contributor Author

@aparajit-pratap aparajit-pratap Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang is there a way to retrieve the host info here? One of the asks for this task is to also determine whether these graph execution requests are being made from Dynamo (host or sandbox) or Player, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HostInfo is available from DynamoModel, but I think when we discuss that with @deepakanand earlier, he prefer to not use HostAnalyticsInfo object to identify player. Maybe he has some other thoughts in mind about implementation


return Exception == null; // Exception thrown == execution failed.
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@ private void TrackStartupAnalytics()
.Select(p => string.Format("{0} {1}", p.Name, p.VersionName))
.Aggregate(String.Empty, (x, y) => string.Format("{0}, {1}", x, y));
}
Analytics.TrackTimedEvent(Categories.Performance, "ViewStartup", dynamoViewModel.Model.stopwatch.Elapsed, packages);
Analytics.TrackTimedEvent(Categories.Performance, Actions.ViewStartup.ToString(), dynamoViewModel.Model.stopwatch.Elapsed, packages);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/NodeServices/Analytics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static void TrackStartupTime(string productName, TimeSpan time, string de
{
var desc = string.IsNullOrEmpty(description)
? productName : string.Format("{0}: {1}", productName, description);
client.TrackTimedEvent(Categories.Performance, "Startup", time, desc);
client.TrackTimedEvent(Categories.Performance, Actions.Startup.ToString(), time, desc);
}
}

Expand Down
15 changes: 15 additions & 0 deletions src/NodeServices/IAnalyticsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,21 @@ public enum Actions
/// Export event, e.g. tracks the ExportSettings event
/// </summary>
Export,

/// <summary>
/// Timed event: tracks startup time
/// </summary>
Startup,

/// <summary>
/// Timed event: tracks view startup time
/// </summary>
ViewStartup,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clean up, we need to add these new waypoints to Analytics.NET repo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These already exist in the analytics repo.


/// <summary>
/// Timed event: tracks graph execution time
/// </summary>
UpdateGraphAsyncTask
}

public enum HeartBeatType
Expand Down
Loading