{"id":17117,"date":"2024-06-10T09:04:50","date_gmt":"2024-06-10T07:04:50","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=17117"},"modified":"2025-10-01T12:12:11","modified_gmt":"2025-10-01T10:12:11","slug":"plotting-sql-server-performance-counters-with-python","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/","title":{"rendered":"Plotting SQL Server Performance counters with Python"},"content":{"rendered":"\n<p>As a consultant, I often use <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/ask-the-performance-team\/windows-performance-monitor-overview\/ba-p\/375481\" target=\"_blank\" rel=\"noreferrer noopener\">Performance Monitor<\/a> (Perfmon) to collect performance metrics for SQL Server. After running Perfmon for, say, a week to capture a baseline of server activity, you can end up with a large amount of data.<\/p>\n\n\n\n<p>Here\u2019s what you might end up with:<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/02\/Blog_27_1_perfmon_raw.jpg\"><img decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/02\/Blog_27_1_perfmon_raw.jpg\" alt=\"\" class=\"wp-image-54396\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Looking at so much information can be overwhelming if you don&#8217;t know exactly what you are looking for. So, how can we extract some useful information from that?<\/p>\n\n\n\n<p>Well, there are not many options:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A commonly used tool is PAL (<a href=\"https:\/\/github.com\/clinthuffman\/PAL\" target=\"_blank\" rel=\"noreferrer noopener\">Performance Analysis of Logs<\/a>) but I&#8217;ve never been a big fan. It&#8217;s not always easy to get relevant information from it.<\/li>\n\n\n\n<li>Another way is to convert your Perfmon log (blg file) to a CSV file and then use Excel to perform data analysis using pivot tables and charts. However, this process can be tedious and time-consuming.<\/li>\n\n\n\n<li>You can also use Power BI to display, filter, and graph the data from the CSV file. This might be the best option, but I&#8217;m not very comfortable with Power BI yet.<\/li>\n<\/ol>\n\n\n\n<p>Not satisfied with these solutions, I decided to build a tool myself. <\/p>\n\n\n\n<p>While I usually rely on PowerShell for database administration tasks, for this one I was ready to try something new. Python, often referred to as the most popular programming language, has seen exponential growth the past years thanks to its use in Data Engineering, Data Science, and Machine Learning.<\/p>\n\n\n\n<p>Although I had never tried Python before, I believe it&#8217;s never too late to learn something new.<br>So here it is. I wrote a small script two years ago (writing a blog post takes time, right?) to help me analyze Perfmon counters.<br>I named it <a href=\"https:\/\/github.com\/relsna\/blg2graph\" target=\"_blank\" rel=\"noreferrer noopener\">blg2graph<\/a> and it&#8217;s available on GitHub.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-to-use\">How to use<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"684\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_options-1024x684.png\" alt=\"\" class=\"wp-image-33466\" style=\"width:606px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_options-1024x684.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_options-300x200.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_options-768x513.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_options.png 1099w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>When you run the main.py script, several options are available:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create CSV files from a Perfmon BLG file.<\/li>\n\n\n\n<li>Get the counters list from a BLG file, mainly for troubleshooting.<\/li>\n\n\n\n<li>Create graphs from a CSV file.<\/li>\n<\/ol>\n\n\n\n<p>Here\u2019s how I use it:<\/p>\n\n\n\n<p><br>First, I start with a single binary .BLG file containing data collected over several days.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"313\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_1_blg.png\" alt=\"\" class=\"wp-image-33458\" style=\"width:543px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_1_blg.png 957w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_1_blg-300x98.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_1_blg-768x251.png 768w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" \/><\/figure>\n<\/div>\n\n\n<p>Using blg2graph, I transform this BLG file into multiple CSVs, one per day.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"956\" height=\"771\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_2_csv.png\" alt=\"\" class=\"wp-image-33462\" style=\"width:536px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_2_csv.png 956w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_2_csv-300x242.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_2_csv-768x619.png 768w\" sizes=\"auto, (max-width: 956px) 100vw, 956px\" \/><\/figure>\n<\/div>\n\n\n<p>Finally, I generate graphs for a specific CSV file, i.e., for a particular day.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1022\" height=\"261\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_3_html.png\" alt=\"\" class=\"wp-image-33463\" style=\"width:542px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_3_html.png 1022w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_3_html-300x77.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_file_explorer_3_html-768x196.png 768w\" sizes=\"auto, (max-width: 1022px) 100vw, 1022px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-output\">Output<\/h3>\n\n\n\n<p>Here is the result, an HTML file containing a chart for each Perfmon counter for a given day.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"627\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_html_graphs-1024x627.png\" alt=\"\" class=\"wp-image-33464\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_html_graphs-1024x627.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_html_graphs-300x184.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_html_graphs-768x470.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_html_graphs-1536x940.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_html_graphs-2048x1254.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>I can now search for the data I am interested in, investigate, try to identify anomalies, and finally use these graphs to illustrate a report or documentation.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"833\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_html_graphs_example-1024x833.png\" alt=\"\" class=\"wp-image-33465\" style=\"width:577px;height:auto\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_html_graphs_example-1024x833.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_html_graphs_example-300x244.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_html_graphs_example-768x625.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/06\/blg2graph_html_graphs_example.png 1249w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-configuration\">Configuration<\/h3>\n\n\n\n<p>I can choose the time range to be used for generating the graphs by modifying the JSON configuration file: config.json.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [3,4]; title: ; notranslate\" title=\"\">\n&quot;timeframe&quot;:{\n        &quot;group_interval&quot;:&quot;1Min&quot;,\n        &quot;start_time&quot;:&quot;06:00:00&quot;,\n        &quot;end_time&quot;:&quot;19:00:00&quot;\n    }\n<\/pre><\/div>\n\n\n<p>I can also choose to generate only specific graphs. To do this, I list the Perfmon counters in the JSON file under &#8220;includeCounters&#8221; and set the &#8220;Apply&#8221; property to TRUE.<br>If set to FALSE, the script will generate graphs for all counters present in the CSV file.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&quot;includeCounters&quot;:{\n        &quot;Apply&quot;:false,\n        &quot;counters&quot;:&#x5B;\n            &quot;Buffer Manager\\\\Buffer cache hit ratio&quot;,\n            &quot;Transactions\/sec&quot;,\n            &quot;Priviledged Time\/sec&quot;\n        ]\n    }\n<\/pre><\/div>\n\n\n<p>Alternatively, I can exclude certain counters using the &#8220;excludeCounters&#8221; object.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-installation\">Installation<\/h3>\n\n\n\n<p>Here are the steps to install Python and run the script on a Windows machine:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Install Python:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Go to the <a href=\"https:\/\/www.python.org\/downloads\/windows\/\" target=\"_blank\" rel=\"noreferrer noopener\">official Python website<\/a>. Download and install the latest version.<\/li>\n\n\n\n<li>Don&#8217;t forget to enable the checkbox &#8220;Add Python to PATH&#8221;.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Download the Python script:<\/strong>\n<ul class=\"wp-block-list\">\n<li>If you have Git installed run <code>git clone https:\/\/github.com\/relsna\/blg2graph.git<\/code>.<\/li>\n\n\n\n<li>If you didn&#8217;t install Git, go to the <a href=\"https:\/\/github.com\/relsna\/blg2graph\" target=\"_blank\" rel=\"noreferrer noopener\">repository page<\/a>, click on &#8220;Code&#8221;, then &#8220;Download ZIP&#8221;.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Install the required Python packages:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Open Command Prompt, or PowerShell Prompt or Terminal and navigate to the directory where you downloaded the script <code>cd C:\\GitHub\\blg2graph<\/code>. .<\/li>\n\n\n\n<li>Run <code>pip install -r requirements.txt<\/code> to install the required Python packages.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Run the Python script:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Still in the same directory, run <code>python main.py<\/code> to start the script.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-next-steps\">Next steps<\/h3>\n\n\n\n<p>In its current state, it is still not easy to analyze the data when there are dozens or even hundreds of graphs on the HTML page.<\/p>\n\n\n\n<p>The next features I want to prioritize for development are:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The ability to group the graphs by instance when the CSV contains counters from multiple SQL Server instances on the same Windows server.<\/li>\n\n\n\n<li>Creating graphs that correlate data from multiple performance counters, for example, to show the evolution of transactions per second and batch requests per second. This could then be configured in the JSON file as follows:<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&quot;graphs&quot;:&#x5B;\n        {\n            &quot;category&quot;:&quot;SQL Activity&quot;,\n            &quot;title&quot;:&quot;SQL Activity&quot;,\n            &quot;kind&quot;:&quot;line&quot;,\n            &quot;colors&quot;: &#x5B;&quot;g&quot;, &quot;b&quot;],\n            &quot;counters&quot;:&#x5B;\n                &quot;SQL Statistics\\\\Batch Requests\/sec&quot;,\n                &quot;Transactions\/sec&quot;\n            ],\n            &quot;threshold&quot;: null\n        },\n        {\n            &quot;category&quot;:&quot;Buffer&quot;,\n            &quot;title&quot;:&quot;CPU&quot;,\n            &quot;kind&quot;:&quot;line&quot;,\n            &quot;colors&quot;: &#x5B;&quot;g&quot;, &quot;b&quot;],\n            &quot;counters&quot;:&#x5B;\n                &quot;Buffer Manager\\\\Buffer cache hit ratio&quot;,\n                &quot;Buffer Manager\\\\Page life expectancy&quot;\n            ],\n            &quot;threshold&quot;:&quot;80&quot;\n        }\n]\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h3>\n\n\n\n<p>Analyzing performance counter data can be hard work. While PAL can significantly ease the pain of analyzing performance counter logs, I found it not quite fitting my needs. <br>That&#8217;s why I created <code>blg2graph<\/code>, a Python script that simplifies the analysis process and helps visualize the data effectively. I use it regularly and I think it could be useful to you if you need to analyze perfmon performance counters.<\/p>\n\n\n\n<p>This is a first working version, and I\u2019m looking forward to improving it. Please use it and share your feedback here in comments or <a href=\"https:\/\/github.com\/relsna\/blg2graph\" target=\"_blank\" rel=\"noreferrer noopener\">on the GitHub repo<\/a>!<\/p>\n\n\n\n<p>Written by <a href=\"https:\/\/www.linkedin.com\/in\/steven-naudet-aa540158\/\">Steven Naudet<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a consultant, I often use Performance Monitor (Perfmon) to collect performance metrics for SQL Server. After running Perfmon for, say, a week to capture a baseline of server activity, you can end up with a large amount of data. Here\u2019s what you might end up with: Looking at so much information can be overwhelming [&hellip;]<\/p>\n","protected":false},"author":26,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229,368,99],"tags":[667,3372,3374,67,3373,51],"type_dbi":[],"class_list":["post-17117","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","category-development-performance","category-sql-server","tag-audit","tag-blg2graph","tag-perfmon","tag-performance","tag-performance-monitor","tag-sql-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Plotting SQL Server Performance counters with Python - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Plotting SQL Server Performance counters with Python\" \/>\n<meta property=\"og:description\" content=\"As a consultant, I often use Performance Monitor (Perfmon) to collect performance metrics for SQL Server. After running Perfmon for, say, a week to capture a baseline of server activity, you can end up with a large amount of data. Here\u2019s what you might end up with: Looking at so much information can be overwhelming [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-10T07:04:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-01T10:12:11+00:00\" \/>\n<meta name=\"author\" content=\"Microsoft Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Microsoft Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/\"},\"author\":{\"name\":\"Microsoft Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"headline\":\"Plotting SQL Server Performance counters with Python\",\"datePublished\":\"2024-06-10T07:04:50+00:00\",\"dateModified\":\"2025-10-01T10:12:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/\"},\"wordCount\":826,\"commentCount\":1,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/02\/Blog_27_1_perfmon_raw.jpg\",\"keywords\":[\"audit\",\"blg2graph\",\"perfmon\",\"Performance\",\"Performance Monitor\",\"SQL Server\"],\"articleSection\":[\"Database Administration &amp; Monitoring\",\"Development &amp; Performance\",\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/\",\"name\":\"Plotting SQL Server Performance counters with Python - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/02\/Blog_27_1_perfmon_raw.jpg\",\"datePublished\":\"2024-06-10T07:04:50+00:00\",\"dateModified\":\"2025-10-01T10:12:11+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/02\/Blog_27_1_perfmon_raw.jpg\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/02\/Blog_27_1_perfmon_raw.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Plotting SQL Server Performance counters with Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\",\"name\":\"Microsoft Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"caption\":\"Microsoft Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Plotting SQL Server Performance counters with Python - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/","og_locale":"en_US","og_type":"article","og_title":"Plotting SQL Server Performance counters with Python","og_description":"As a consultant, I often use Performance Monitor (Perfmon) to collect performance metrics for SQL Server. After running Perfmon for, say, a week to capture a baseline of server activity, you can end up with a large amount of data. Here\u2019s what you might end up with: Looking at so much information can be overwhelming [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/","og_site_name":"dbi Blog","article_published_time":"2024-06-10T07:04:50+00:00","article_modified_time":"2025-10-01T10:12:11+00:00","author":"Microsoft Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Microsoft Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/"},"author":{"name":"Microsoft Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"headline":"Plotting SQL Server Performance counters with Python","datePublished":"2024-06-10T07:04:50+00:00","dateModified":"2025-10-01T10:12:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/"},"wordCount":826,"commentCount":1,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/02\/Blog_27_1_perfmon_raw.jpg","keywords":["audit","blg2graph","perfmon","Performance","Performance Monitor","SQL Server"],"articleSection":["Database Administration &amp; Monitoring","Development &amp; Performance","SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/","url":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/","name":"Plotting SQL Server Performance counters with Python - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/02\/Blog_27_1_perfmon_raw.jpg","datePublished":"2024-06-10T07:04:50+00:00","dateModified":"2025-10-01T10:12:11+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/02\/Blog_27_1_perfmon_raw.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/02\/Blog_27_1_perfmon_raw.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/plotting-sql-server-performance-counters-with-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Plotting SQL Server Performance counters with Python"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4","name":"Microsoft Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","caption":"Microsoft Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/17117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=17117"}],"version-history":[{"count":24,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/17117\/revisions"}],"predecessor-version":[{"id":40628,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/17117\/revisions\/40628"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=17117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=17117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=17117"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=17117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}