Skip to content

Commit

Permalink
Merge pull request #2180 from microsoft/MeasureEmailDelayInMTL3
Browse files Browse the repository at this point in the history
Documentation fixes.
  • Loading branch information
dpaulson45 authored Aug 30, 2024
2 parents 5980b43 + 2e6ffcf commit 95f66a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Transport/Measure-EmailDelayInMTL.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,11 @@ foreach ($id in $uniqueMessageIDs) {
$SortedTimeDelivered = (($AllStoreDeliverTimes + $AllRemoteDeliverTimes) | Sort-Object | Select-Object -Last 1)

# Build report object
$report = [PSCustomObject]@{
MessageID = $id
TimeSent = $TimeSent
TimeReceived = $SortedTimeSent
MessageDelay = $SortedTimeDelivered - $SortedTimeSent

# Build output object
[array]$output = [array]$output + $report
[array]$output += [PSCustomObject]@{
MessageID = $id
TimeSent = $SortedTimeSent
TimeReceived = $SortedTimeDelivered
MessageDelay = $SortedTimeDelivered - $SortedTimeSent
}
}

Expand All @@ -201,7 +198,7 @@ if ($null -eq $output) {

# Export the data to the output file
$outputFile = (Join-Path -Path $ReportPath -ChildPath ("MTL_Latency_Report_" + (Get-Date -Format FileDateTime).ToString() + ".csv"))
$output | Export-Csv -IncludeTypeInformation:$false -Path $outputFile
$output | Sort-Object -Property MessageDelay -Descending | Export-Csv -IncludeTypeInformation:$false -Path $outputFile
Write-Output ("Report written to file " + $outputFile)

# Gather general statistical data and output to the screen
Expand Down
4 changes: 4 additions & 0 deletions docs/Transport/Measure-EmailDelayInMTL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Measure-EmailDelayInMTL
Download the latest release: [Measure-EmailDelayInMTL.ps1](https://github.com/microsoft/CSS-Exchange/releases/latest/download/Measure-EmailDelayInMTL.ps1)

Generates a report of the maximum message delay for all messages in an Message Tracking Log output.

## DESCRIPTION
Expand Down Expand Up @@ -42,6 +44,8 @@ Folder path for the output file.
| TimeReceived | Last delivery time in the MTL |
| MessageDelay | How long before the message was delivered |

#### Note: When loading the CSV in Excel the Message Delay column will need to be formatted as a time span.

### Statistical Summary

| Statistic | Description |
Expand Down

0 comments on commit 95f66a7

Please sign in to comment.