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-6451] Analytics for ML DataPipeline. #14936

Merged
merged 4 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion src/DynamoMLDataPipeline/DynamoMLDataPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public static string ConstructCreateAssetRequestBody(string schemaNamespaceId, s
parameterComponent.AddParameterFromSchema("<Add dynamo host>", hostSchema);
parameterComponent.AddParameterFromSchema("<Add dynamo version>", dynamoVersionSchema);

Analytics.TrackEvent(Actions.DynamoMLDataPipieline, Categories.DynamoMLDataPipelineOperations, "Host", Convert.ToInt32(hostSchema));
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't host name already part of each data entry? Do we still need to send it separately?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean Dynamo already sends host info(during startup or after it) to analytics, so we don't need it here. I was thinking we might want to know which host is sending a request to the ML pipeline and thats why we need it here. What do you think? It was added in the JIRA task.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this.


// Construct the base component
var baseComponent = new BaseComponent("DynamoGraphLog");
// Construct the binary reference component
Expand Down Expand Up @@ -161,7 +163,7 @@ static public string ConvertDynToBase64(string filePath)
byte[] compressedBuffer = DataUtilities.Compress(stringBuffer);

string base64CompressedBuffer = Convert.ToBase64String(compressedBuffer);
LogMessage.Info($"BASE64 string buffer has {base64CompressedBuffer.Length} bytes");
LogMessage.Info($"BASE64 string buffer has {base64CompressedBuffer.Length} bytes");

// Write to file for testing purposes
File.WriteAllText(savePath, base64CompressedBuffer);
Expand All @@ -184,6 +186,8 @@ static void DataExchangeToForge(string filePath, RestClient client, string token
// from the response - these will be consumed by the following API calls.
ExchangeContainerId = exchangeRequestResponseBody["id"].Value;

Analytics.TrackEvent(Actions.DynamoMLDataPipieline, Categories.DynamoMLDataPipelineOperations, "ExchangeContainerID", Convert.ToInt32(ExchangeContainerId));

var schemaNamespaceId = exchangeRequestResponseBody["components"]["data"]["insert"]["autodesk.data:exchange.source.default-1.0.0"]["source"]["String"]["id"].Value;

// STEP 2: START A FULLFILLMENT ---------------------
Expand Down Expand Up @@ -225,6 +229,8 @@ static void DataExchangeToForge(string filePath, RestClient client, string token
}
LogMessage.Info("Binary upload started!");

Analytics.TrackEvent(Actions.DynamoMLDataPipieline, Categories.DynamoMLDataPipelineOperations, "BinarySize", base64CompressedBuffer.Length);

// STEP 4b: FINISH BINARY UPLOAD -------------------
// Finish uploading binary assets: Let the system know that the binary assets have been uploaded and are ready for processing.
// This call can be made for a single binary or a batch of 25 binaries.
Expand Down Expand Up @@ -310,6 +316,7 @@ public void DataExchange(string filePath)
// Stage collectionId created for Dynamo
CollectionId = ProductionCollectionID;

Analytics.TrackEvent(Actions.DynamoMLDataPipieline, Categories.DynamoMLDataPipelineOperations, "CollectionID", Convert.ToInt32(CollectionId));
//ExchangeContainerId = "";

var forgeClient = new RestClient(ProductionClientUrl);
Expand Down
12 changes: 11 additions & 1 deletion src/NodeServices/IAnalyticsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ public enum Categories
/// Events Category related to the splash screen
/// </summary>
SplashScreenOperations,

/// <summary>
/// Events Category related to DynamoMLDataPipeline
/// </summary>
DynamoMLDataPipelineOperations
}

/// <summary>
Expand Down Expand Up @@ -443,7 +448,12 @@ public enum Actions
/// <summary>
/// Export event, e.g. tracks the ExportSettings event
/// </summary>
Export
Export,

/// <summary>
/// Dynamo ML data pipeline.
/// </summary>
DynamoMLDataPipieline
reddyashish marked this conversation as resolved.
Show resolved Hide resolved
}

public enum HeartBeatType
Expand Down
Loading