Hi,
Here is a simple PS script, which shows the graphical view of the stats you are looking for. Note that, this is a very basic script works for a single website and you need to enhance it further to work on multiple sites
Note: Set the appropriate values for the parameters as per your setup. ResourceName "manutest" ResourceGroupName "manurg1"
Give Start and End Time accordingly
# inputs
$WarningPreference = 'SilentlyContinue'
$TimeGrain = [timespan]::FromMinutes(1)
$Start = [datetime]::Now.AddMinutes(-40)
$End = [datetime]::Now.AddMinutes(-1)
# capture resource metrics
$Resource = Get-AzResource -ResourceName "manutest" -ResourceGroupName "manurg1" -ResourceType "Microsoft.Web/sites"
$ResourceID = $Resource.ResourceId
$MetricName = 'BytesSent'
$Splat = @{
ResourceId = $ResourceID
MetricName = $MetricName
TimeGrain = $TimeGrain
StartTime = $Start
EndTime = $End
}
$Data = Get-AzMetric @Splat
$Datpoints = $data.data.average.foreach({[int]$_})
# plot the graph
Show-Graph -Datapoints $Datpoints -GraphTitle $MetricName -YAxisStep 5
Show-Graph -Datapoints $Datpoints -GraphTitle $MetricName -YAxisStep 5 -Type Line
Show-Graph -Datapoints $Datpoints -GraphTitle $MetricName -YAxisStep 5 -Type Scatter
$MetricName = 'BytesReceived'
$Splat = @{
ResourceId = $ResourceID
MetricName = $MetricName
TimeGrain = $TimeGrain
StartTime = $Start
EndTime = $End
}
$Data = Get-AzMetric @Splat
$Datpoints = $data.data.average.foreach({[int]$_})
# plot the graph
Show-Graph -Datapoints $Datpoints -GraphTitle $MetricName -YAxisStep 5
Show-Graph -Datapoints $Datpoints -GraphTitle $MetricName -YAxisStep 5 -Type Line
Show-Graph -Datapoints $Datpoints -GraphTitle $MetricName -YAxisStep 5 -Type Scatter
$MetricName = 'Requests'
$Splat = @{
ResourceId = $ResourceID
MetricName = $MetricName
TimeGrain = $TimeGrain
StartTime = $Start
EndTime = $End
}
$Data = Get-AzMetric @Splat
$Datpoints = $data.data.average.foreach({[int]$_})
# plot the graph
Show-Graph -Datapoints $Datpoints -GraphTitle $MetricName -YAxisStep 5
Show-Graph -Datapoints $Datpoints -GraphTitle $MetricName -YAxisStep 5 -Type Line
Show-Graph -Datapoints $Datpoints -GraphTitle $MetricName -YAxisStep 5 -Type Scatter
Regards,
Manu