Skip to content

Instantly share code, notes, and snippets.

@pipin68k
Created December 14, 2014 13:08
Show Gist options
  • Save pipin68k/7916984b1cbb880c2e70 to your computer and use it in GitHub Desktop.
Save pipin68k/7916984b1cbb880c2e70 to your computer and use it in GitHub Desktop.
Grouping Time Taken
Read-ApacheLog *.log|
?{($_.Status -eq 200) -and ($_.Path -like "*.php")}|
Group-Object Date|
%{
$m = $_ | select -ExpandProperty Group | measure -Property TimeTaken -Average -Maximum -Minimum
$_ | Add-Member Average $m.Average
$_ | Add-Member Max $m.Maximum
$_ | Add-Member Min $m.Minimum
$_
}|
select Name, Count, Average, Max, Min|
ft -AutoSize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment