AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 30.08.2018, 02:49   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
stoneridgesoftware: Developing with Windows Performance Monitor Counters
Источник: https://stoneridgesoftware.com/devel...itor-counters/
==============

Microsoft’s preferred tool to measure the performance of Windows systems is the Performance Monitor. It provides an analysis chart view with metrics for the Last, Average, Minimum and Maximum values of the performance counters from an imported performance Binary Log File (.blg).

The Performance Monitor is a nice tool to view one file at a time, but sometimes it can become time consuming and limited. However, there is good news. Windows Performance monitor counters can be extracted and developed by software to provide automation and customization.

PowerShell

PowerShell is a Microsoft task-based command-line shell and scripting language, and it can be used to parse performance counter instances into objects imported from performance files. Also, it is able to convert Binary Log Files (.blg) into a few other formats, such as Comma Separate Values (.csv) for easier viewing or another software compatibility.

The following is an example from Microsoft of using PowerShell to select data from a performance file and export it to a new file:



Click here for more information from Microsoft on Import-Counter.

The Problem with PowerShell

When importing and parsing performance counter instances into objects, it is possible to access the value of each one. Therefore, it is easy enough to calculate straightforward metrics for a data set including Last, Minimum, and Maximum. The not so straightforward metric to calculate is average.

When calculating the average of performance counters, it is important to consider the cardinality of the data. It is even more important when calculating against counters whose values are already an average, such as, the Avg. Disk sec/Read counter. Hence, the above two reasons are why it is confusing to calculate the averages of performance counters. The standard formula for average: total sum/number of items – will not be the correct representation of values from the Performance Monitor. Microsoft recommends developers to use PdhComputeCounterStatistics to correctly calculate averages from performance counter data.

Note: Along with PowerShell, if a user tries to calculate averages after converting a performance file to CSV, it will be incorrect as well.

It may not be impossible to calculate the correct averages with PowerShell. Click here for more from Microsoft information about formulas.

PdhComputeCounterStatistics (C++)

PdhComputeCounterStatistics is a part of the Windows application programming interface. It can be accessed and used when developing a Microsoft C++ project. It is Microsoft’s recommendation when calculating averages for performance counter data.

To dig in a little further for developers, the PdhComputeCounterStatistic is a C++ function that computes statistics for a certain performance counter from an array of raw values. It then returns a structure that holds the counter statistics – Last, Average, Minimum, Maximum.

The following is the documented syntax from Microsoft for the PdhComputeCounterStatsitcs function.



If you want to learn more about Developing with Windows Performance Counters, Click here for more information about these functions, or send us an email.



Источник: https://stoneridgesoftware.com/devel...itor-counters/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
stoneridgesoftware: PrecisionForms for Document Management in Dynamics AX Blog bot DAX Blogs 0 14.09.2017 19:11
stoneridgesoftware: Part I: Configuring the Dynamics AX 2012 R3 Entity Store Blog bot DAX Blogs 0 27.04.2017 12:11
emeadaxsupport: AX Performance Troubleshooting Checklist Part 2 Blog bot DAX Blogs 0 09.09.2014 16:11
MSDAX 4.0 и планировщик win server 2008 werov2010 DAX: Администрирование 11 16.08.2012 14:18
Client Axapta 3.0 SP4 и Linux. Как запустить? Daiver DAX: Администрирование 10 28.06.2007 15:59

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 00:39.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.