What is the sampling interval on a Win32_PerfFormattedData class? Can I change it?












0














We've got a few questions here covering how to determine per-process CPU usage. The most "turnkey" way is to run a WMI query using Win32_PerfFormattedData_PerfProc_Process to get PercentProcessorTime.



These "formatted" classes are wrappers around the corresponding raw version of the class, e.g., Win32_PerfRawData_PerfProc_Process. The documentation for Win32_PerfFormattedData_PerfProc_Process tells us its values are formed from the raw class using a CookingType of PERF_100NSEC_TIMER with a PerfTimeFreq of Frequency_Sys100NS. This means that the interval used to calculate the values from the raw class is whatever the value of Frequency_Sys100NS is.



Now, if I look at properties like Frequency_Sys100NS on instances of the data returned from the formatted class, they are NULL. But on the raw class, I do see a value of 10000000, which I am guessing means the formatted class gets raw values separated by 1 second (10000000 * 100NS = 1 second).



Am I interpreting this right? Is there any way to change the sampling frequency of the classes to get per process CPU usage sampled over a larger or smaller interval? I could use the raw classes and do it myself, keeping track of per-process raw values, but it would be nice to leverage the existing infrastructure to do the work for me.










share|improve this question



























    0














    We've got a few questions here covering how to determine per-process CPU usage. The most "turnkey" way is to run a WMI query using Win32_PerfFormattedData_PerfProc_Process to get PercentProcessorTime.



    These "formatted" classes are wrappers around the corresponding raw version of the class, e.g., Win32_PerfRawData_PerfProc_Process. The documentation for Win32_PerfFormattedData_PerfProc_Process tells us its values are formed from the raw class using a CookingType of PERF_100NSEC_TIMER with a PerfTimeFreq of Frequency_Sys100NS. This means that the interval used to calculate the values from the raw class is whatever the value of Frequency_Sys100NS is.



    Now, if I look at properties like Frequency_Sys100NS on instances of the data returned from the formatted class, they are NULL. But on the raw class, I do see a value of 10000000, which I am guessing means the formatted class gets raw values separated by 1 second (10000000 * 100NS = 1 second).



    Am I interpreting this right? Is there any way to change the sampling frequency of the classes to get per process CPU usage sampled over a larger or smaller interval? I could use the raw classes and do it myself, keeping track of per-process raw values, but it would be nice to leverage the existing infrastructure to do the work for me.










    share|improve this question

























      0












      0








      0







      We've got a few questions here covering how to determine per-process CPU usage. The most "turnkey" way is to run a WMI query using Win32_PerfFormattedData_PerfProc_Process to get PercentProcessorTime.



      These "formatted" classes are wrappers around the corresponding raw version of the class, e.g., Win32_PerfRawData_PerfProc_Process. The documentation for Win32_PerfFormattedData_PerfProc_Process tells us its values are formed from the raw class using a CookingType of PERF_100NSEC_TIMER with a PerfTimeFreq of Frequency_Sys100NS. This means that the interval used to calculate the values from the raw class is whatever the value of Frequency_Sys100NS is.



      Now, if I look at properties like Frequency_Sys100NS on instances of the data returned from the formatted class, they are NULL. But on the raw class, I do see a value of 10000000, which I am guessing means the formatted class gets raw values separated by 1 second (10000000 * 100NS = 1 second).



      Am I interpreting this right? Is there any way to change the sampling frequency of the classes to get per process CPU usage sampled over a larger or smaller interval? I could use the raw classes and do it myself, keeping track of per-process raw values, but it would be nice to leverage the existing infrastructure to do the work for me.










      share|improve this question













      We've got a few questions here covering how to determine per-process CPU usage. The most "turnkey" way is to run a WMI query using Win32_PerfFormattedData_PerfProc_Process to get PercentProcessorTime.



      These "formatted" classes are wrappers around the corresponding raw version of the class, e.g., Win32_PerfRawData_PerfProc_Process. The documentation for Win32_PerfFormattedData_PerfProc_Process tells us its values are formed from the raw class using a CookingType of PERF_100NSEC_TIMER with a PerfTimeFreq of Frequency_Sys100NS. This means that the interval used to calculate the values from the raw class is whatever the value of Frequency_Sys100NS is.



      Now, if I look at properties like Frequency_Sys100NS on instances of the data returned from the formatted class, they are NULL. But on the raw class, I do see a value of 10000000, which I am guessing means the formatted class gets raw values separated by 1 second (10000000 * 100NS = 1 second).



      Am I interpreting this right? Is there any way to change the sampling frequency of the classes to get per process CPU usage sampled over a larger or smaller interval? I could use the raw classes and do it myself, keeping track of per-process raw values, but it would be nice to leverage the existing infrastructure to do the work for me.







      wmi cpu-usage wmi-query






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 12 at 15:04









      aggieNick02

      97711019




      97711019





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53264908%2fwhat-is-the-sampling-interval-on-a-win32-perfformatteddata-class-can-i-change-i%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53264908%2fwhat-is-the-sampling-interval-on-a-win32-perfformatteddata-class-can-i-change-i%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Xamarin.iOS Cant Deploy on Iphone

          Glorious Revolution

          Dulmage-Mendelsohn matrix decomposition in Python