function performance_average in Performance Logging and Monitoring 7
Same name and namespace in other branches
- 6 performance.module \performance_average()
Calculate average. Note that this will always lose accuracy. In the 2.0 version we will NOT store the average anymore, but we will store the sum of all values and the number of accesses. That way we calculate the average when displaying without losing accuracy.
1 call to performance_average()
- performance_build_summary_data in ./
performance.module - Helper function to build summary data array.
File
- ./
performance.module, line 466 - Logs detailed and/or summary page generation time and memory consumption for page requests. Copyright Khalid Baheyeldin 2008 of http://2bits.com
Code
function performance_average($original_avg, $value, $weight) {
return ($original_avg * $weight + $value) / ($weight + 1);
}