@@ -134,6 +134,9 @@ await this.Logger.LogMessageAsync($"{this.TypeName}.ProcessSummaryFileUploads",
134134 // Upload the workload summary logs (e.g. metrics.csv) before exiting. We do this at the very end. Same as before, we do not
135135 // honor the cancellation token until ALL files have been successfully processed.
136136 await this . UploadCsvSummaryFilesAsync ( blobManager , relatedContext ) ;
137+
138+ // Upload specific summary.txt at root level of logs directory.
139+ await this . UploadSummaryFileAsync ( blobManager , relatedContext ) ;
137140 } ) ;
138141
139142 break ;
@@ -233,6 +236,48 @@ private async Task<bool> UploadFilesAsync(IBlobManager blobManager, EventContext
233236 return filesFound ;
234237 }
235238
239+ private async Task UploadSummaryFileAsync ( IBlobManager blobManager , EventContext telemetryContext )
240+ {
241+ try
242+ {
243+ string suffix = string . IsNullOrEmpty ( this . ExperimentId ) ? string . Empty : $ "-{ this . ExperimentId } ";
244+ string summaryTxtFileLocation = Path . Combine ( this . PlatformSpecifics . LogsDirectory , $ "summary{ suffix } .txt") ;
245+ bool summaryTxtFileExists = this . fileSystem . File . Exists ( summaryTxtFileLocation ) ;
246+ telemetryContext
247+ . AddContext ( nameof ( summaryTxtFileLocation ) , summaryTxtFileLocation )
248+ . AddContext ( nameof ( summaryTxtFileExists ) , summaryTxtFileExists ) ;
249+
250+ if ( summaryTxtFileExists )
251+ {
252+ try
253+ {
254+ FileUploadDescriptor descriptor = this . CreateFileUploadDescriptor (
255+ new FileContext (
256+ this . fileSystem . FileInfo . New ( summaryTxtFileLocation ) ,
257+ "text/plain" ,
258+ Encoding . UTF8 . WebName ,
259+ this . ExperimentId ,
260+ this . AgentId ) ) ;
261+
262+ await this . UploadFileAsync ( blobManager , this . fileSystem , descriptor , CancellationToken . None ) ;
263+ }
264+ catch ( IOException exc ) when ( exc . Message . Contains ( "being used by another process" , StringComparison . OrdinalIgnoreCase ) )
265+ {
266+ // It is common that there will be read/write access errors at certain times while
267+ // upload request files are being created at the same time as attempts to read.
268+ }
269+ catch ( Exception exc )
270+ {
271+ this . Logger . LogErrorMessage ( exc , telemetryContext , LogLevel . Warning ) ;
272+ }
273+ }
274+ }
275+ catch ( Exception exc )
276+ {
277+ this . Logger . LogErrorMessage ( exc , telemetryContext , LogLevel . Error ) ;
278+ }
279+ }
280+
236281 private async Task UploadCsvSummaryFilesAsync ( IBlobManager blobManager , EventContext telemetryContext )
237282 {
238283 try
0 commit comments