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

Method updateAverageCounter

src/stat.cpp:848–862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

846}
847
848void CStat::updateAverageCounter(E_CounterName P_SumCounter,
849 E_CounterName P_NbOfCallUsed,
850 E_CounterName P_Squares,
851 unsigned long P_value)
852{
853 if (M_counters [P_NbOfCallUsed] <= 0) {
854 M_counters [P_NbOfCallUsed] ++;
855 M_counters [P_SumCounter] = P_value;
856 M_counters [P_Squares] = (P_value * P_value);
857 } else {
858 M_counters [P_SumCounter] += P_value;
859 M_counters [P_Squares] += (P_value * P_value);
860 M_counters [P_NbOfCallUsed] ++;
861 }
862}
863
864int CStat::computeStat (E_Action P_action,
865 unsigned long P_value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected