new pass at websocket telemetry and prepare for capture
This commit is contained in:
33
OpenJibo/scripts/cloud/Get-WebSocketCaptureSummary.ps1
Normal file
33
OpenJibo/scripts/cloud/Get-WebSocketCaptureSummary.ps1
Normal file
@@ -0,0 +1,33 @@
|
||||
param(
|
||||
[string]$CaptureDirectory = "..\..\src\Jibo.Cloud\dotnet\src\Jibo.Cloud.Api\bin\Debug\net10.0\captures\websocket"
|
||||
)
|
||||
|
||||
$resolvedDirectory = Resolve-Path -LiteralPath $CaptureDirectory -ErrorAction Stop
|
||||
$eventFiles = Get-ChildItem -LiteralPath $resolvedDirectory -Filter *.events.ndjson -File | Sort-Object LastWriteTimeUtc
|
||||
|
||||
if (-not $eventFiles) {
|
||||
Write-Host "No websocket telemetry event files found in $resolvedDirectory"
|
||||
exit 0
|
||||
}
|
||||
|
||||
$records = foreach ($file in $eventFiles) {
|
||||
Get-Content -LiteralPath $file.FullName | Where-Object { $_.Trim().Length -gt 0 } | ForEach-Object {
|
||||
$_ | ConvertFrom-Json
|
||||
}
|
||||
}
|
||||
|
||||
$records |
|
||||
Group-Object EventType |
|
||||
Sort-Object Name |
|
||||
Select-Object Name, Count |
|
||||
Format-Table -AutoSize
|
||||
|
||||
$fixtureDirectory = Join-Path $resolvedDirectory "fixtures"
|
||||
if (Test-Path -LiteralPath $fixtureDirectory) {
|
||||
Write-Host ""
|
||||
Write-Host "Exported websocket fixtures:"
|
||||
Get-ChildItem -LiteralPath $fixtureDirectory -Filter *.flow.json -File |
|
||||
Sort-Object LastWriteTimeUtc |
|
||||
Select-Object LastWriteTimeUtc, Name |
|
||||
Format-Table -AutoSize
|
||||
}
|
||||
Reference in New Issue
Block a user