Simple Software License
The following is an attempt to make license agreements easy to read and understand.
This software is provided AS IS. Demachina is not responsible for anything.
Do not resell this software or make it available to others in any shape or form other
than by providing a link to http://www.demachina.com/products/perfy/.
If you are actively using the product then you are morally obliged to pay for it via
http://www.demachina.com/products/perfy/. If you actual do
pay is between you, your conscious, your family and your god.
Don't be evil.
Payment
As mentioned in the Software License, a payment of $50 per developer can be made
on the Perfy website at http://www.demachina.com/products/perfy/download.html.
Functionality
Perfy exposes various Windows CE system and application specific counters via the
standard Windows performance monitor.
If you are not familiar with the Windows performance monitor then please check out
the following resources:
The new counters can be divided in 2 categories:
- Windows CE System Counters: These counters expose system wide statistics such as
Battery level and memory load (full list provided below). The information is
available in real time.
- Windows CE Compact Framework Counters: The .net Compact Framework exposes a
number of statistics such as Bytes Allocated and Number of PInvoke calls (full
list is provided below). However, unfortunately the way this is implemented allows
us to only get and display this information after the application terminates.
Sample scenarios
Let's work out a couple of sample scenarios:
- Battery usage: We have identified a problem with the battery, it runs out faster
than expected. We want to measure the impact a certain application has on the
battery life. We need to perform the following steps to test the impact:
- make sure the Windows CE device is connected via active sync
- make sure the Windows CE device is fully charged
- Make sure Perfy is running
- Start the Windows Performance monitor from the Administrative Tools
- Remove whatever counters are currently being tracked
- Add a counter by clicking on the '+' icon
- Select the performance object 'Windows CE counters'
- Select the '% remaining battery life' counter and click 'Add'
- Setup a 'Counter log' to log this information to a csv file as well so the data
can later by graphed in Excel.
- First we are generating a baseline so make sure no application is running on
the Windows CE device.
- Unplug the power cable from the device (while keeping ActiveSync connected)
- Start logging.
- When the battery has completely run out, stop logging and rename the CSV file
to 'baseline.csv'
- Make sure the device is fully charged again
- Start the application you want to measure the battery impact for
- Unplug the power cable from the device (while keeping ActiveSync connected)
- Start logging.
- When the battery has completely run out, stop logging and give the CSV files
sensible names.
The CSV files can now be imported into Excel and comparison graphs can be made.
- In this scenario we want to measure the number of objects created during the run
time of the application. This can be done by following the steps below:
- make sure the Windows CE device is connected via active sync
- Make sure Perfy is running
- Start the Windows Performance monitor from the Administrative Tools
- Remove whatever counters are currently being tracked
- Add a counter by clicking on the '+' icon
- Select the performance object 'Windows CE Compact Framework'
- Select the 'Number Of Objects Allocated' counter and click 'Add'
- Select the 'Total Program Run Time' counter and click 'Add'
- Setup a 'Counter log' to log this information to a csv file as well so the data
can later by graphed or calculated in Excel.
- Ensure that no Compact Framework applications are running as only one can be
profiled at a time.
- Start the .net CF application that you want to measure
- Let it run for as long as you need to
- Stop the application again
- Now that the application is stopped, the performance counters will be updated
Repeat this test after making code changes to see if the situation has improved.
As the 'Total Program Run Time' counter is also being tracked it is a relatively
simple calculation to compare one test run with another in an objective manner.
Full list of counters
- Category - Windows CE Compact Framework Counters
- Execution Engine Startup Time
- Total Program Run Time
- Peak Bytes Allocated
- Number Of Objects Allocated
- Bytes Allocated
- Number Of Simple Collections
- Bytes Collected By Simple Collection
- Bytes In Use After Simple Collection
- Time In Simple Collect
- Number Of Compact Collections
- Bytes Collected By Compact Collections
- Bytes In Use After Compact Collection
- Time In Compact Collect
- Number Of Full Collections
- Bytes Collected By Full Collection
- Bytes In Use After Full Collection
- Time In Full Collection
- GC Number Of Application Induced Collections
- GC Latency Time
- Bytes Jitted
- Native Bytes Jitted
- Number of Methods Jitted
- Bytes Pitched
- Number of Methods Pitched
- Number of Exceptions
- Number of Calls
- Number of Virtual Calls
- Number Of Virtual Call Cache Hits
- Number of PInvoke Calls
- Total Bytes In Use After Collection
- Category - Windows CE Counters
- Available Physical Memory
- Current memory load (%)
- Total physical memory
- Total page files
- Available page files
- Total virtual memory
- Available virtual memory
- AC Power status
- Battery flag
- % Remaining battery life
- Total battery life
- Battery life remaining
- Backup battery present
- % Backup battery life remaining
- Backup battery life time remaining
- Backup total life
Known issues
- The data is only gathered after the .net CF process terminates on the Windows CE
device and no other .net CF processes are running. This is a limitation in
Microsoft's implementation.
- The Application will attempt to enable performance counters on the device during
startup. However, if the device is not connected at that time, the counter will
need to be stopped and started again using the icon in the notification area.
- Depending on the device, not all counters may return a value as for example
multiple batteries are not available in every device.
- Unfortunately it does not seem possible on Windows CE.net to get detailed process
information such as memory and cpu usage for non .net CF processes. If this
functionality is added to the OS, it will definitely be exposed via Perfy.
- When recording counters to disk, an error may occur in Microsoft's smlogsvc.exe.
The source of this error is unclear. As a workaround just try and start the counter
again.