c# - Write to same performance counter from multiple processes -
i'm using newer system.diagnostics.performancedata set of api's write counters , increment / decrement single counter multiple processes simultaneously.
i've tried tweaking countersetinstancetype in various ways no success:
if use multiple or multipleaggregate see single instance in perfmon, there separate counter each process , overwrite each other. same behavior happens single counterset type.
when try gloablaggregate counterset type performance monitor doesn't seem read values @ all.
answering own question:
as documented here: http://msdn.microsoft.com/en-us/library/windows/desktop/ee781345%28v=vs.90%29.aspx
you need specify how aggregate counters within manifest file (by setting aggregate attribute each counter).
it appear not doing cause counters stay @ 0 / undefined.
in case of globalaggregate works perfectly.
in case of multipleaggregate has impact on _total instance created counterset automatically (as result of defining multipleaggregate). other instances remain @ old behavior.
there seems 'multipleinstanceaggregate' counter type far can tell unsupported manifest schema. (see: http://msdn.microsoft.com/en-us/library/system.diagnostics.performancedata.countersetinstancetype)
Comments
Post a Comment