This tool,NProf modelled on .NUnit looks good. It looks like it will take the hard work of performance testing. 

The framework provides custom attributes that the user uses the tag benchmark classes and methods. If you are familiar with NUnit [1], this is similar to the custom attributes they provide.  The framework uses reflection to gather the benchmark testers, the tested types, runs the tests and output the results. The user just have to write the benchmark methods.

The article also has a good code snipet on how to get machine properties. It looks great simple way of getting information out about the system.

Getting the physical properties of the machine was a suprisingly difficult task. It took me a bunch of google tries to get on the right pages. Anyway, here’s the self-explaining code that get the machine properties:

ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * From Win32_ComputerSystem");
foreach(ManagementObject obj in query.Get())
{ long ram = long.Parse(obj["TotalPhysicalMemory"].ToString());
break;
}
query = new ManagementObjectSearcher("SELECT * From Win32_Processor");
foreach(ManagementObject obj in query.Get())
{ string cpu =(string)obj["Name"];
long cpuFrequency =long.Parse(obj["CurrentClockSpeed"].ToString());
break;
}

via James Avery

Advertisements