MCPcopy Create free account
hub / github.com/SIPp/sipp / computeRtdStdev

Method computeRtdStdev

src/stat.cpp:833–846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831}
832
833double CStat::computeRtdStdev(int which, int type)
834{
835 unsigned long long count = M_rtdInfo[((which - 1) * RTD_TYPES * GENERIC_TYPES) + (type * RTD_TYPES) + RTD_COUNT];
836 unsigned long long sum = M_rtdInfo[((which - 1) * RTD_TYPES * GENERIC_TYPES) + (type * RTD_TYPES) + RTD_SUM];
837 unsigned long long sumsq = M_rtdInfo[((which - 1) * RTD_TYPES * GENERIC_TYPES) + (type * RTD_TYPES) + RTD_SUMSQ];
838
839 if (count <= 1)
840 return 0.0;
841
842 double numerator = ((double)count * (double)sumsq) - (double)(sum * sum);
843 double denominator = (double)(count) * ((double)(count) - 1.0);
844
845 return sqrt(numerator/denominator);
846}
847
848void CStat::updateAverageCounter(E_CounterName P_SumCounter,
849 E_CounterName P_NbOfCallUsed,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected