Skip to content

Commit dd9c7af

Browse files
authored
[DYN-6451] Analytics for ML DataPipeline. (DynamoDS#14936)
* ML DataPipeline analytics * comments * comments * Update DynamoMLDataPipeline.cs
1 parent 6538bc7 commit dd9c7af

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/DynamoMLDataPipeline/DynamoMLDataPipeline.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static public string ConvertDynToBase64(string filePath)
161161
byte[] compressedBuffer = DataUtilities.Compress(stringBuffer);
162162

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

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

187+
Analytics.TrackEvent(Actions.Export, Categories.DynamoMLDataPipelineOperations, "ExchangeContainerID", Convert.ToInt32(ExchangeContainerId));
188+
187189
var schemaNamespaceId = exchangeRequestResponseBody["components"]["data"]["insert"]["autodesk.data:exchange.source.default-1.0.0"]["source"]["String"]["id"].Value;
188190

189191
// STEP 2: START A FULLFILLMENT ---------------------
@@ -225,6 +227,8 @@ static void DataExchangeToForge(string filePath, RestClient client, string token
225227
}
226228
LogMessage.Info("Binary upload started!");
227229

230+
Analytics.TrackEvent(Actions.Export, Categories.DynamoMLDataPipelineOperations, "BinarySize", base64CompressedBuffer.Length);
231+
228232
// STEP 4b: FINISH BINARY UPLOAD -------------------
229233
// Finish uploading binary assets: Let the system know that the binary assets have been uploaded and are ready for processing.
230234
// This call can be made for a single binary or a batch of 25 binaries.
@@ -310,6 +314,7 @@ public void DataExchange(string filePath)
310314
// Stage collectionId created for Dynamo
311315
CollectionId = ProductionCollectionID;
312316

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

315320
var forgeClient = new RestClient(ProductionClientUrl);

src/NodeServices/IAnalyticsClient.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ public enum Categories
138138
/// Events Category related to the splash screen
139139
/// </summary>
140140
SplashScreenOperations,
141+
142+
/// <summary>
143+
/// Events Category related to DynamoMLDataPipeline
144+
/// </summary>
145+
DynamoMLDataPipelineOperations
141146
}
142147

143148
/// <summary>
@@ -443,7 +448,7 @@ public enum Actions
443448
/// <summary>
444449
/// Export event, e.g. tracks the ExportSettings event
445450
/// </summary>
446-
Export
451+
Export,
447452
}
448453

449454
public enum HeartBeatType

0 commit comments

Comments
 (0)