none
Add New Prefmon Counters to exist category succeded, but the new counter is not updated never RRS feed

  • Question

  • I'm trying to add new counter to existing custom category.

    I delete the category using PerformanceCounterCategory.Delete  and recreate it  by PerformanceCounterCategory.Create with the list of old counters + the new counter.

    All counters added successfully (the new and olds) but the new counter value is never updated even i increase the value or change is raw value. The old counters working.

    If i change the name for one of old counters the counter created with new name but value never updated , same behavior as the new counter.

    If I add the new counter to new category it is back to work, and the value updated.

    I'm working on .Net 4.5 on Windows 2008 64 bit.

    Monday, June 9, 2014 8:17 AM

Answers

  • Hi,

    The MSDN example is not appropriate in this case because the category is created only once with new counters, and i'm talking about category recreation in the second time with additional counter. 

    But I understand what caused the problem:

    I have a monitor tool which sample this category counters.

    If the tool running while category recreation (with new additional counters) the counters will not be increased until I will close the tool and restart my process.

    Thank you for the help.

    Friday, June 13, 2014 7:11 AM

All replies

  • HI Yael,

    Here is the similar question I’ve found, please refer to the following link for details. http://stackoverflow.com/questions/3734277/performance-counter-created-but-not-working-until-windows-restart.

    Please let me know the result.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, June 10, 2014 1:37 AM
    Moderator
  • It's not helped.

    I tried to stop the prefmon monitor and data collectors, and also to restart the windows, but still the old counters working and new counters not working.

    p.s. - sometimes, when i increase the new counter, one of the old counters increased, which not happened if I create them all with new category name - STRANGE!
    • Edited by Yael A Tuesday, June 10, 2014 9:12 AM
    Tuesday, June 10, 2014 6:58 AM
  • HI Yael,

    Please provide a simple project to help me reproduce your problem. I’ve tested the code example on the following MSDN page. It worked fine. Share a project here and I will look at it. Thank you for understanding.

    http://msdn.microsoft.com/en-us/library/vstudio/system.diagnostics.performancecounter.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, June 12, 2014 8:09 AM
    Moderator
  • Hi,

    The MSDN example is not appropriate in this case because the category is created only once with new counters, and i'm talking about category recreation in the second time with additional counter. 

    But I understand what caused the problem:

    I have a monitor tool which sample this category counters.

    If the tool running while category recreation (with new additional counters) the counters will not be increased until I will close the tool and restart my process.

    Thank you for the help.

    Friday, June 13, 2014 7:11 AM