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

[Cherry-pick] [DYN-6451] Analytics for ML DataPipeline. (#14936) #14964

Merged
merged 1 commit into from
Feb 23, 2024
Merged
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
7 changes: 6 additions & 1 deletion src/DynamoMLDataPipeline/DynamoMLDataPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,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 +184,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.Export, 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 +227,8 @@ static void DataExchangeToForge(string filePath, RestClient client, string token
}
LogMessage.Info("Binary upload started!");

Analytics.TrackEvent(Actions.Export, 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 +314,7 @@ public void DataExchange(string filePath)
// Stage collectionId created for Dynamo
CollectionId = ProductionCollectionID;

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

var forgeClient = new RestClient(ProductionClientUrl);
Expand Down
7 changes: 6 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,7 @@ public enum Actions
/// <summary>
/// Export event, e.g. tracks the ExportSettings event
/// </summary>
Export
Export,
}

public enum HeartBeatType
Expand Down
Loading