Monday, 15 September 2014

c# - PerformanceCounter extremely slow in connecting remote server -



c# - PerformanceCounter extremely slow in connecting remote server -

i seek utilize performancecounter monitor remote server info in domain environment, like:

var counter = new performancecounter("physicaldisk", "disk bytes/sec", "_total", "remote_server");

there 1 line of code, running above code wait @ to the lowest degree 50 seconds.

i tried impersonate admin etc, still same time.

i tried powershell get-counter, still more or less speed.

i tried windows native performance monitoring tool in computer management, connect remote server, takes few sec only.

any thought how improve connection speed?

if monitoring local computer, i've found if seek , monitor localhost 1 min or greater waits when setting performancecounter objects. if instead utilize 127.0.0.1 seems help.

however, still happens when monitoring remote machines. update if find solution, believe there alternative library called pdh into.

c# performancecounter remote-server

No comments:

Post a Comment