"Portable" qpmset files / force localhost


I recently wanted to share some qpmset files I made with my coworkers. I faced the issue that you save the hostname into the qpmset files. Although this is totally makes senses as this is part of the perf counter path and allow to monitor processes on remote machines, this makes difficult to share qpmset files for monitoring local processes. I made a script that changes the hostname to the localhost before starting QPerfMon but this is not ideal. It would be better if QPerfMon could do it itself ;)
So here's my proposal: add the ability to indicate to QPerfMon that it should replace the machine name with the current machine name when loading a qpmset file.
I thought about two ways to achieve this:
  • It could be done with a simple check box like "force local" in the performance counter selection dialog. The information would be saved in the qpmset file with each perf counter.
  • An other way would be to add a command line switch (in this case, this would be for all perf counter of a qpmset file).
    I can try to hack the code and submit a patch if you want.


RudolfHenning wrote Apr 13, 2012 at 12:19 PM

Interesting idea. One question though, you do know that the '.' (dot) as machine name automatically defaults to the local machine. e.g. .\Processor\% Processor Time_Total would always run on the 'local machine' no matter which machine you run it on?
I know the dialog box in my tool defaults to change the '.' to the full machine name but you can edit the name out again and replace it with a '.' (dot). Then when you save it and reload it again the '.' remains meaning that it will open on the 'local' machine.
Does this helps?

andreone wrote Apr 13, 2012 at 4:20 PM

Well I I tested the dot trick and it didn't work. I guess I corrupted the xml because I just retested it and that works.
My proposal still makes sense but I can live with a little edition once in a while.