ROHC compression/decompression library
Functions
rohc_stats.c File Reference

Handle a rolling window of values for statistics. More...

#include "rohc_stats.h"
Include dependency graph for rohc_stats.c:

Functions

void rohc_stats_add (struct rohc_stats *const stats, const uint32_t value)
 Add a new value in the given statistics context.
uint32_t ROHC_EXPORT rohc_stats_sum (const struct rohc_stats *const stats)
 Compute the sum of all the recorded values.
uint32_t rohc_stats_mean (const struct rohc_stats *const stats)
 Compute the mean of all the recorded values.

Detailed Description

Handle a rolling window of values for statistics.

Author:
Didier Barvaux <didier@barvaux.org>

Function Documentation

void rohc_stats_add ( struct rohc_stats *const  stats,
const uint32_t  value 
)

Add a new value in the given statistics context.

Parameters:
statsThe statistics context
valueThe value to add
uint32_t rohc_stats_mean ( const struct rohc_stats *const  stats)

Compute the mean of all the recorded values.

Parameters:
statsThe statistics context
Returns:
The mean of the recorded values
uint32_t ROHC_EXPORT rohc_stats_sum ( const struct rohc_stats *const  stats)

Compute the sum of all the recorded values.

This function is used for statistics.

Parameters:
statsThe statistics context
Returns:
The sum of the recorded values