是否有任何C#的框架或$​​ C $ C解析* BLG性能比较计数器日志文件?计数器、框架、有任何、性能

由网友(Estrus.( 动情))分享简介:的任务不是收集性能计数器数据在我的.NET应用程序,但已经打开的prepared二进制日志文件(*的.blg)?The task is not to gather Performance counters data in my .NET app, but open already prepared binary lo...

的任务不是收集性能计数器数据在我的.NET应用程序,但已经打开的prepared二进制日志文件(*的.blg)?

The task is not to gather Performance counters data in my .NET app, but open already prepared binary log files (*.blg)?

我知道,MS SQL事件探查器(.NET应用程序)可以分析二进制日志。

I know that MS SQL Profiler (.NET app) can parse binary logs.

推荐答案

从我可以找到它似乎的.blg文件格式是专有的,规格是不公开发表。话虽如此,我不认为你将能够找到一个框架或库,做这种格式的原始解析。编写一个库来解析这种格式不规范也不是没有风险的,因为假设可能将不得不作出...即使你扭转工程师的二进制格式始终有你想念某些规则在你的解析器的实现造成的机会潜在问题的道路。

From what I can find it seems that the .blg file format is proprietary and the spec is not openly published. That said I don't think you will be able to find a framework or library that does raw parsing of this format. Writing a library to parse this format without the spec is not without risk since assumptions will likely have to be made... even if you were to reverse engineer the binary format there is always the chance that you miss certain rules in your parser implementation causing potential problems down the road.

这是说,我能想到的2其他选项在.NET应用程序解析二进制日志文件以供使用。

That said, I can think of 2 other options for parsing binary log files for use within a .NET application.

PowerShell中的导入柜台的cmdlet的可用于导入从计数器数据BLG文件造成的源代码中的每个计数器样本的对象。所得到的输出可以以多种方式使用。我能想到的最简单的例子是将源转换为CSV格式进行进一步的处理:

PowerShell's Import-Counter cmdlet could be used to import counter data from a blg file resulting in objects for each counter sample in the source. The resulting output can be used in a number of ways. The simplest example I can think of would be to convert your source to CSV format for further processing:

C: PS> $数据=进口柜台。 exampledata.blg C: PS> $数据|出口计数器-path output.csv -FileFormat CSV

C:PS> $data = import-counter .exampledata.blg C:PS> $data | export-counter -path .output.csv -FileFormat csv

重新记录是另一种选择。这是一个命令行工具附带大多数主要的Windows操作系统版本。同样,这里所述的方法是将BLG文件转换成CSV格式转换为容易解析。例如:

relog is another option. This is a command line utility that ships with most major versions of the Windows OS. Again, the approach here would be to convert the blg file into CSV format for easy parsing. Example:

重新记录-f CSV inputfile.blg -o outputFile.csv

鉴于上述选项,你应该能够从那里走。这将是使用C#程序Process.Start()

Given the options above you should be able to go from there. It would be quite easy run powershell or relog from a C# program using Process.Start()

阅读全文

相关推荐

最新文章