Skip to content

Commit

Permalink
[DYN-6451] Analytics for ML DataPipeline. (DynamoDS#14936)
Browse files Browse the repository at this point in the history
* ML DataPipeline analytics

* comments

* comments

* Update DynamoMLDataPipeline.cs
  • Loading branch information
reddyashish authored Feb 16, 2024
1 parent 6538bc7 commit dd9c7af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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

0 comments on commit dd9c7af

Please sign in to comment.