![Microsoft Operations Management Suite Cookbook](https://wfqqreader-1252317822.image.myqcloud.com/cover/3/36700003/b_36700003.jpg)
Working with time charts
Azure Log Analytics also provides time-charting capabilities. With time charts you can show the average fiftieth and ninety-fifth percentiles of a performance counter over a period of time. Consider the need to show the average fiftieth and ninety-fifth percentiles of the bytes total/sec performance counter in bins of 1 hour. To do this, go through the following method:
- In the new query field in the Analytics portal, type the following query into the search field:
Perf | where TimeGenerated > ago(1d) | where CounterName == "Bytes Total/sec" | summarize avg(CounterValue), percentiles(CounterValue, 50, 95) by bin(TimeGenerated, 1h)
- Click the Go button
in the upper right-hand corner of your screen to return a distribution of your data over the last day. By default, the results are displayed in a table.
- In the result pane, click Chart to render a multidimensional depiction of the data with various value combinations. Click Stacked Column and select Line to display a line chart:
![](https://epubservercos.yuewen.com/02BCAB/19470394901574106/epubprivate/OEBPS/Images/0522cca1-c218-4379-9bdc-b69231bfaf29.png?sign=1739238636-VGEtU7GZdBFyK0cgiFlfrj0nO8JII4GK-0-675f57bd227df7f5ee9efc6a93637b3a)
With time charts in Azure Log Analytics, you can incorporate thresholds into charts using reference lines to easily identify and visualize when a metric exceeds a specific threshold of interest. To do this, use the extend tabular operator to create and initialize a calculated column and append it as a threshold value to the result set. To do this, go through the following steps:
- Modify the query expression in the search field to extend the result set with a constant column that serves as a threshold:
Perf
| where TimeGenerated > ago(1d)
| where CounterName == "Bytes Total/sec"
| summarize avg(CounterValue), percentiles(CounterValue, 50,
95) by bin(TimeGenerated, 1h)
| extend Threshold = 100000
- Click the Go button
in the upper right-hand corner of your screen to return a distribution of your data over the last day. By default, the results are displayed in a table:
![](https://epubservercos.yuewen.com/02BCAB/19470394901574106/epubprivate/OEBPS/Images/97a926e4-d788-411d-858e-27518d6b5dce.png?sign=1739238636-pzTATgFjIRXc570oInS2ODV4N7zs2oPB-0-96b466181afbf7914672f8b56c9596dc)
- In the results pane, click Chart to render a multidimensional depiction of the data with various value combinations. Click Stacked Column and select Line to display a line chart with a visible threshold line:
![](https://epubservercos.yuewen.com/02BCAB/19470394901574106/epubprivate/OEBPS/Images/f3fd8768-638b-493e-8bcb-cf790af4f13e.png?sign=1739238636-C0DuCES7ydNktj3SGUq0nbTfQFSxpppG-0-a04216917d5f54ec7285508026703352)