Sampling Interval

The Sampling interval is the frequency of data collection. When performing event-based sampling, the VTune analyzer uses the Sampling interval to determine the target number of samples, and the Sample After value during the calibration run. To calculate the average number of samples collected per event, use the formula: Duration (sec) * 1000ms/1sec * 1/(Sampling interval (ms) /sample).

Example:

If Duration = 10 seconds and Sampling interval = 1 millisecond, the number of samples collected is calculated as follows:

10(sec) * 1000ms /1(sec) * 1 / 1ms / 1 sample) = 10000 samples

This number of samples collected is multiplied by Duration to get the target number of samples that will be collected for an event in an Activity run. The Sample After value is calculated based off the target number of samples for an event.

To determine an appropriate Sampling interval, consider the Duration of the collection, the speed of your processors, and the amount of software activity. For instance, if the Duration of sampling time is more than 10 minutes, consider increasing the Sampling interval to 50 milliseconds. This reduces the number of interrupts and the number of samples collected and written to disk. The smaller the Sampling interval, the larger the number of samples collected and written to disk.

To adjust the sampling interval, use -si | -sampling-interval <interval in milliseconds>.

Example:

vtl activity -d 5 -c sampling -o "-ec en='clockticks' -si 4"

This example creates and runs an Activity with the sampling collector for 20 seconds using a sampling interval of 4ms. The sampling collector uses the event-based sampling (default) and collects samples for the clockticks event. The calibration run will calculate the Sample After value for the event using a 4ms sampling interval. During the sampling run the sampling collector will use the calculated Sample After value. After the clockticks event occurs, a Sample After value number of times a sample will be taken. See the Calibration topic for more information.