\doxysection{Statistics reporting}
\label{group__stats}\index{Statistics reporting@{Statistics reporting}}


This module implements periodic reporting of statistics / counters.  


\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ stats.\+h}
\item 
file \textbf{ stats.\+c}
\item 
file \textbf{ stats\+\_\+statsd.\+c}
\item 
file \textbf{ stats\+\_\+tcp.\+c}
\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+stats\+\_\+reporter}
\begin{DoxyCompactList}\small\item\em One statistics reporter instance. \end{DoxyCompactList}\item 
struct \textbf{ osmo\+\_\+stats\+\_\+config}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ TRACE}(probe)
\item 
\#define \textbf{ TRACE\+\_\+\+ENABLED}(probe)~(0)
\item 
\#define \textbf{ STATS\+\_\+\+DEFAULT\+\_\+\+INTERVAL}~5 /$\ast$ secs $\ast$/
\item 
\#define \textbf{ STATS\+\_\+\+DEFAULT\+\_\+\+BUFLEN}~256
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ osmo\+\_\+stats\+\_\+class} \{ \newline
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+UNKNOWN}
, \newline
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+GLOBAL}
, \newline
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+PEER}
, \newline
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+SUBSCRIBER}
 \}
\begin{DoxyCompactList}\small\item\em Statistics Class definitions. \end{DoxyCompactList}\item 
enum \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+type} \{ \newline
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+REPORTER\+\_\+\+LOG}
, \newline
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+REPORTER\+\_\+\+STATSD}
 \}
\begin{DoxyCompactList}\small\item\em Statistics Reporter Type. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ vty\+\_\+out\+\_\+stat\+\_\+item\+\_\+group2} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg, bool skip\+\_\+zero)
\item 
void \textbf{ vty\+\_\+out\+\_\+stat\+\_\+item\+\_\+group} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg)
\item 
void \textbf{ osmo\+\_\+stats\+\_\+init} (void $\ast$ctx)
\begin{DoxyCompactList}\small\item\em Initialize the stats reporting module; call this once in your program. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+stats\+\_\+report} (void)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+set\+\_\+interval} (int interval)
\begin{DoxyCompactList}\small\item\em Set the reporting interval (common for all reporters) \end{DoxyCompactList}\item 
struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$ \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+alloc} (enum \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+type} \textbf{ type}, const char $\ast$\textbf{ name})
\item 
void \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+free} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep)
\begin{DoxyCompactList}\small\item\em Destroy a given stats\+\_\+reporter. \end{DoxyCompactList}\item 
struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$ \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+find} (enum \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+type} \textbf{ type}, const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Find a stats\+\_\+reporter of given {\itshape type} and {\itshape name}. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+remote\+\_\+addr} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const char $\ast$addr)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+remote\+\_\+port} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, int port)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+local\+\_\+addr} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const char $\ast$addr)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+mtu} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, int mtu)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+max\+\_\+class} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, enum \textbf{ osmo\+\_\+stats\+\_\+class} class\+\_\+id)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+name\+\_\+prefix} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const char $\ast$prefix)
\begin{DoxyCompactList}\small\item\em Set the name prefix of a given stats\+\_\+reporter. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+enable} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep)
\begin{DoxyCompactList}\small\item\em Enable the given stats\+\_\+reporter. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+disable} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep)
\begin{DoxyCompactList}\small\item\em Disable the given stats\+\_\+reporter. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+flush\+\_\+period} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, unsigned int period)
\begin{DoxyCompactList}\small\item\em Set the regular flush period for a given stats\+\_\+reporter. \end{DoxyCompactList}\item 
struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$ \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+log} (const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Create a stats\+\_\+reporter that logs via libosmocore logging. \end{DoxyCompactList}\item 
struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$ \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+statsd} (const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Create a stats\+\_\+reporter reporting to statsd. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+send} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const char $\ast$\textbf{ data}, int data\+\_\+len)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+send\+\_\+buffer} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+udp\+\_\+open} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+udp\+\_\+close} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep)
\item 
\textbf{ LLIST\+\_\+\+HEAD} (\textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+list})
\item 
static int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send\+\_\+counter} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg, const struct \textbf{ rate\+\_\+ctr\+\_\+desc} $\ast$\textbf{ desc}, int64\+\_\+t value, int64\+\_\+t delta)
\item 
static int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send\+\_\+item} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg, const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+desc} $\ast$\textbf{ desc}, int64\+\_\+t value)
\item 
static int \textbf{ update\+\_\+srep\+\_\+config} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep)
\item 
static int \textbf{ osmo\+\_\+stats\+\_\+timer\+\_\+cb} (struct \textbf{ osmo\+\_\+fd} $\ast$ofd, unsigned int what)
\item 
static int \textbf{ start\+\_\+timer} (void)
\item 
static int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const char $\ast$\textbf{ type}, const char $\ast$name1, unsigned int index1, const char $\ast$name2, int value, const char $\ast$unit)
\item 
static int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+check\+\_\+config} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, unsigned int index, int class\+\_\+id)
\item 
static int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+send\+\_\+counter} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg, const struct \textbf{ rate\+\_\+ctr\+\_\+desc} $\ast$\textbf{ desc}, int64\+\_\+t value, int64\+\_\+t delta)
\item 
static int \textbf{ rate\+\_\+ctr\+\_\+handler} (struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg, struct \textbf{ rate\+\_\+ctr} $\ast$ctr, const struct \textbf{ rate\+\_\+ctr\+\_\+desc} $\ast$\textbf{ desc}, void $\ast$sctx\+\_\+)
\item 
static int \textbf{ rate\+\_\+ctr\+\_\+group\+\_\+handler} (struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg, void $\ast$sctx\+\_\+)
\item 
static int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+send\+\_\+item} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg, const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+desc} $\ast$\textbf{ desc}, int32\+\_\+t value)
\item 
static int \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+handler} (struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg, struct \textbf{ osmo\+\_\+stat\+\_\+item} $\ast$item, void $\ast$sctx\+\_\+)
\item 
static int \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+handler} (struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg, void $\ast$sctx\+\_\+)
\item 
static int \textbf{ handle\+\_\+counter} (struct \textbf{ osmo\+\_\+counter} $\ast$counter, void $\ast$sctx\+\_\+)
\item 
static void \textbf{ flush\+\_\+all\+\_\+reporters} (void)
\item 
static int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send\+\_\+counter} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg, const struct \textbf{ rate\+\_\+ctr\+\_\+desc} $\ast$\textbf{ desc}, int64\+\_\+t value, int64\+\_\+t delta)
\item 
static int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send\+\_\+item} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg, const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+desc} $\ast$\textbf{ desc}, int64\+\_\+t value)
\item 
static void \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+sanitize\+\_\+name} (char $\ast$buf)
\begin{DoxyCompactList}\small\item\em Replace all illegal \textquotesingle{}\+:\textquotesingle{} in the stats name, but not when used as value seperator. \end{DoxyCompactList}\item 
static int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, const char $\ast$name1, const char $\ast$index1, const char $\ast$name2, int64\+\_\+t value, const char $\ast$unit)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+tcp\+\_\+osmo\+\_\+fd\+\_\+register} (const struct \textbf{ osmo\+\_\+fd} $\ast$fd, const char $\ast$\textbf{ name})
\item 
int \textbf{ osmo\+\_\+stats\+\_\+tcp\+\_\+osmo\+\_\+fd\+\_\+unregister} (const struct \textbf{ osmo\+\_\+fd} $\ast$fd)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+tcp\+\_\+set\+\_\+interval} (int interval)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ llist\+\_\+head} \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+list}
\item 
struct \textbf{ osmo\+\_\+stats\+\_\+config} $\ast$ \textbf{ osmo\+\_\+stats\+\_\+config}
\item 
static void $\ast$ \textbf{ osmo\+\_\+stats\+\_\+ctx} = NULL
\item 
static int \textbf{ is\+\_\+initialised} = 0
\item 
static struct \textbf{ osmo\+\_\+stats\+\_\+config} \textbf{ s\+\_\+stats\+\_\+config}
\item 
struct \textbf{ osmo\+\_\+stats\+\_\+config} $\ast$ \textbf{ osmo\+\_\+stats\+\_\+config} = \&\textbf{ s\+\_\+stats\+\_\+config}
\item 
static struct \textbf{ osmo\+\_\+fd} \textbf{ osmo\+\_\+stats\+\_\+timer} = \{ .fd = -\/1 \}
\item 
static struct \textbf{ osmo\+\_\+tcp\+\_\+stats\+\_\+config} \textbf{ s\+\_\+tcp\+\_\+stats\+\_\+config}
\item 
struct \textbf{ osmo\+\_\+tcp\+\_\+stats\+\_\+config} $\ast$ \textbf{ osmo\+\_\+tcp\+\_\+stats\+\_\+config} = \&\textbf{ s\+\_\+tcp\+\_\+stats\+\_\+config}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This module implements periodic reporting of statistics / counters. 

It supports the notion of multiple \doxyref{osmo\+\_\+stats\+\_\+reporter}{p.}{structosmo__stats__reporter} objects which independently of each other can report statistics at different configurable intervals to different destinations.

In order to use this facility, you have to call \doxyref{osmo\+\_\+stats\+\_\+init()}{p.}{group__stats_gab6f9cb91a533a0b2a30cd075ec811acc} once at application start-\/up and then create one or more \doxyref{osmo\+\_\+stats\+\_\+reporter}{p.}{structosmo__stats__reporter}, either using the direct API functions or by using the optional VTY bindings\+:


\begin{DoxyItemize}
\item reporting to any of the libosmocore log targets \doxyref{osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+log()}{p.}{group__stats_gaa6e7ebfa5b99d90a5b465c93c8d40175} creates a new stats\+\_\+reporter which reports to the libosmcoore \doxyref{Osmocom logging framework}{p.}{group__logging} subsystem.
\item reporting to statsd (a front-\/end proxy for the Graphite/\+Carbon metrics server \doxyref{osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+statsd()}{p.}{group__stats_ga82f58af39526c20141673c7c33e8b1cc} creates a new stats\+\_\+reporter which reports via UDP to statsd.
\end{DoxyItemize}

You can either use the above API functions directly to create \doxyref{osmo\+\_\+stats\+\_\+reporter}{p.}{structosmo__stats__reporter} instances, or you can use the VTY support contained in libosmovty. See the \char`\"{}stats\char`\"{} configuration node installed by osmo\+\_\+stats\+\_\+vty\+\_\+\+Add\+\_\+cmds().

An \doxyref{osmo\+\_\+stats\+\_\+reporter}{p.}{structosmo__stats__reporter} reports statistics on all of the following libosmocore internal counter/statistics objects\+:
\begin{DoxyItemize}
\item \doxyref{osmo\+\_\+counter}{p.}{structosmo__counter}
\item \doxyref{Rate counters}{p.}{group__rate__ctr}
\item \doxyref{Statistics value item}{p.}{group__osmo__stat__item}
\end{DoxyItemize}

You do not need to do anything in particular to expose a given counter or stat\+\_\+item, they are all exported automatically via any \doxyref{osmo\+\_\+stats\+\_\+reporter}{p.}{structosmo__stats__reporter}. If you have multiple \doxyref{osmo\+\_\+stats\+\_\+reporter}{p.}{structosmo__stats__reporter}, they will each report all counters/stat\+\_\+items. 

\doxysubsection{Macro Definition Documentation}
\mbox{\label{group__stats_ga9f25eb15952748082b42df8b60d563ce}} 
\index{Statistics reporting@{Statistics reporting}!STATS\_DEFAULT\_BUFLEN@{STATS\_DEFAULT\_BUFLEN}}
\index{STATS\_DEFAULT\_BUFLEN@{STATS\_DEFAULT\_BUFLEN}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{STATS\_DEFAULT\_BUFLEN}
{\footnotesize\ttfamily \#define STATS\+\_\+\+DEFAULT\+\_\+\+BUFLEN~256}

\mbox{\label{group__stats_gac2bb04a248ead7da04e3012ed277b003}} 
\index{Statistics reporting@{Statistics reporting}!STATS\_DEFAULT\_INTERVAL@{STATS\_DEFAULT\_INTERVAL}}
\index{STATS\_DEFAULT\_INTERVAL@{STATS\_DEFAULT\_INTERVAL}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{STATS\_DEFAULT\_INTERVAL}
{\footnotesize\ttfamily \#define STATS\+\_\+\+DEFAULT\+\_\+\+INTERVAL~5 /$\ast$ secs $\ast$/}

\mbox{\label{group__stats_ga9b44d241a9984069d3c9de002b6c149c}} 
\index{Statistics reporting@{Statistics reporting}!TRACE@{TRACE}}
\index{TRACE@{TRACE}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{TRACE}
{\footnotesize\ttfamily \#define TRACE(\begin{DoxyParamCaption}\item[{}]{probe }\end{DoxyParamCaption})}

\mbox{\label{group__stats_gaa753ae2ccad22fb27615272c6b2b04e0}} 
\index{Statistics reporting@{Statistics reporting}!TRACE\_ENABLED@{TRACE\_ENABLED}}
\index{TRACE\_ENABLED@{TRACE\_ENABLED}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{TRACE\_ENABLED}
{\footnotesize\ttfamily \#define TRACE\+\_\+\+ENABLED(\begin{DoxyParamCaption}\item[{}]{probe }\end{DoxyParamCaption})~(0)}



\doxysubsection{Enumeration Type Documentation}
\mbox{\label{group__stats_gafddb6e01c247cdbeed1be06d9796aea3}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_class@{osmo\_stats\_class}}
\index{osmo\_stats\_class@{osmo\_stats\_class}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_class}
{\footnotesize\ttfamily enum \textbf{ osmo\+\_\+stats\+\_\+class}}



Statistics Class definitions. 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_STATS\_CLASS\_UNKNOWN@{OSMO\_STATS\_CLASS\_UNKNOWN}!Statistics reporting@{Statistics reporting}}\index{Statistics reporting@{Statistics reporting}!OSMO\_STATS\_CLASS\_UNKNOWN@{OSMO\_STATS\_CLASS\_UNKNOWN}}}\mbox{\label{group__stats_ggafddb6e01c247cdbeed1be06d9796aea3a0459a5d9b53597f2203ec2d77dfbc2a8}} 
OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+UNKNOWN&unknown class \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_STATS\_CLASS\_GLOBAL@{OSMO\_STATS\_CLASS\_GLOBAL}!Statistics reporting@{Statistics reporting}}\index{Statistics reporting@{Statistics reporting}!OSMO\_STATS\_CLASS\_GLOBAL@{OSMO\_STATS\_CLASS\_GLOBAL}}}\mbox{\label{group__stats_ggafddb6e01c247cdbeed1be06d9796aea3a3ad84bbf056b57bdc89e245c56174038}} 
OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+GLOBAL&global counter/stat\+\_\+item \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_STATS\_CLASS\_PEER@{OSMO\_STATS\_CLASS\_PEER}!Statistics reporting@{Statistics reporting}}\index{Statistics reporting@{Statistics reporting}!OSMO\_STATS\_CLASS\_PEER@{OSMO\_STATS\_CLASS\_PEER}}}\mbox{\label{group__stats_ggafddb6e01c247cdbeed1be06d9796aea3a2ecdba3d9fb058b4599b47fce4e74471}} 
OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+PEER&peer in a communications link \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_STATS\_CLASS\_SUBSCRIBER@{OSMO\_STATS\_CLASS\_SUBSCRIBER}!Statistics reporting@{Statistics reporting}}\index{Statistics reporting@{Statistics reporting}!OSMO\_STATS\_CLASS\_SUBSCRIBER@{OSMO\_STATS\_CLASS\_SUBSCRIBER}}}\mbox{\label{group__stats_ggafddb6e01c247cdbeed1be06d9796aea3a5e588a697b84b76f628a63e2acb54f5e}} 
OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+SUBSCRIBER&subscriber \\
\hline

\end{DoxyEnumFields}
\mbox{\label{group__stats_ga920dfa18cd7fbbf34f52c6dcf92d692d}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_type@{osmo\_stats\_reporter\_type}}
\index{osmo\_stats\_reporter\_type@{osmo\_stats\_reporter\_type}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_type}
{\footnotesize\ttfamily enum \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+type}}



Statistics Reporter Type. 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_STATS\_REPORTER\_LOG@{OSMO\_STATS\_REPORTER\_LOG}!Statistics reporting@{Statistics reporting}}\index{Statistics reporting@{Statistics reporting}!OSMO\_STATS\_REPORTER\_LOG@{OSMO\_STATS\_REPORTER\_LOG}}}\mbox{\label{group__stats_gga920dfa18cd7fbbf34f52c6dcf92d692da359f33b122453c1bfbbdcd4028091f6a}} 
OSMO\+\_\+\+STATS\+\_\+\+REPORTER\+\_\+\+LOG&libosmocore logging \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{OSMO\_STATS\_REPORTER\_STATSD@{OSMO\_STATS\_REPORTER\_STATSD}!Statistics reporting@{Statistics reporting}}\index{Statistics reporting@{Statistics reporting}!OSMO\_STATS\_REPORTER\_STATSD@{OSMO\_STATS\_REPORTER\_STATSD}}}\mbox{\label{group__stats_gga920dfa18cd7fbbf34f52c6dcf92d692da46bb81b0d1d1fe55f6fa50018e82cba8}} 
OSMO\+\_\+\+STATS\+\_\+\+REPORTER\+\_\+\+STATSD&statsd backend \\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\mbox{\label{group__stats_ga2e835741c94f1a7f0ca732cc3bcbd3b5}} 
\index{Statistics reporting@{Statistics reporting}!flush\_all\_reporters@{flush\_all\_reporters}}
\index{flush\_all\_reporters@{flush\_all\_reporters}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{flush\_all\_reporters()}
{\footnotesize\ttfamily static void flush\+\_\+all\+\_\+reporters (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::flush\+\_\+period}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::flush\+\_\+period\+\_\+counter}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::force\+\_\+single\+\_\+flush}, \textbf{ list}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+list}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+send\+\_\+buffer()}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+::running}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+report()}.

\mbox{\label{group__stats_gaaf185b3549510e956756cad507846f93}} 
\index{Statistics reporting@{Statistics reporting}!handle\_counter@{handle\_counter}}
\index{handle\_counter@{handle\_counter}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{handle\_counter()}
{\footnotesize\ttfamily static int handle\+\_\+counter (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+counter} $\ast$}]{counter,  }\item[{void $\ast$}]{sctx\+\_\+ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+counter\+::description}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::force\+\_\+single\+\_\+flush}, \textbf{ list}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ osmo\+\_\+counter\+::name}, \textbf{ osmo\+\_\+counter\+\_\+difference()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+list}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+send\+\_\+counter()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::running}, and \textbf{ osmo\+\_\+counter\+::value}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+report()}.

\mbox{\label{group__stats_ga4cfa9333d7da6952b2b86af3f3c5f1ae}} 
\index{Statistics reporting@{Statistics reporting}!LLIST\_HEAD@{LLIST\_HEAD}}
\index{LLIST\_HEAD@{LLIST\_HEAD}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{LLIST\_HEAD()}
{\footnotesize\ttfamily LLIST\+\_\+\+HEAD (\begin{DoxyParamCaption}\item[{\textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+list}}]{ }\end{DoxyParamCaption})}

\mbox{\label{group__stats_ga1f68226f8cab58ed861ed06aa70eeacc}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stat\_item\_group\_handler@{osmo\_stat\_item\_group\_handler}}
\index{osmo\_stat\_item\_group\_handler@{osmo\_stat\_item\_group\_handler}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stat\_item\_group\_handler()}
{\footnotesize\ttfamily static int osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+handler (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$}]{statg,  }\item[{void $\ast$}]{sctx\+\_\+ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+for\+\_\+each\+\_\+item()}, and \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+handler()}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+report()}.

\mbox{\label{group__stats_gaf542dbe9d1e8d114dc9b81af94ed9f04}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stat\_item\_handler@{osmo\_stat\_item\_handler}}
\index{osmo\_stat\_item\_handler@{osmo\_stat\_item\_handler}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stat\_item\_handler()}
{\footnotesize\ttfamily static int osmo\+\_\+stat\+\_\+item\+\_\+handler (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$}]{statg,  }\item[{struct \textbf{ osmo\+\_\+stat\+\_\+item} $\ast$}]{item,  }\item[{void $\ast$}]{sctx\+\_\+ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+desc\+::class\+\_\+id}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+::desc}, \textbf{ osmo\+\_\+stat\+\_\+item\+::desc}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::force\+\_\+single\+\_\+flush}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+::idx}, \textbf{ list}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+period\+::max}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+flush()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+check\+\_\+config()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+list}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+send\+\_\+item()}, \textbf{ osmo\+\_\+stat\+\_\+item\+::reported}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::running}, and \textbf{ osmo\+\_\+stat\+\_\+item\+::value}.



Referenced by \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+handler()}.

\mbox{\label{group__stats_gab6f9cb91a533a0b2a30cd075ec811acc}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_init@{osmo\_stats\_init}}
\index{osmo\_stats\_init@{osmo\_stats\_init}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_init()}
{\footnotesize\ttfamily void osmo\+\_\+stats\+\_\+init (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx }\end{DoxyParamCaption})}



Initialize the stats reporting module; call this once in your program. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctx} & Talloc context from which stats related memory is allocated \\
\hline
\end{DoxyParams}


References \textbf{ osmo\+\_\+tcp\+\_\+stats\+\_\+config\+::interval}, \textbf{ is\+\_\+initialised}, \textbf{ osmo\+\_\+stats\+\_\+ctx}, \textbf{ osmo\+\_\+stats\+\_\+tcp\+\_\+set\+\_\+interval()}, and \textbf{ start\+\_\+timer()}.

\mbox{\label{group__stats_ga7b9e1f1d7a9e1e469fbb796bbe019fbc}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_report@{osmo\_stats\_report}}
\index{osmo\_stats\_report@{osmo\_stats\_report}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_report()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+report (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



References \textbf{ flush\+\_\+all\+\_\+reporters()}, \textbf{ handle\+\_\+counter()}, \textbf{ osmo\+\_\+counters\+\_\+for\+\_\+each()}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+for\+\_\+each\+\_\+group()}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+handler()}, \textbf{ rate\+\_\+ctr\+\_\+for\+\_\+each\+\_\+group()}, \textbf{ rate\+\_\+ctr\+\_\+group\+\_\+handler()}, and \textbf{ TRACE}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+timer\+\_\+cb()}.

\mbox{\label{group__stats_ga0a6f227702938604e3162499395a1a9d}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_alloc@{osmo\_stats\_reporter\_alloc}}
\index{osmo\_stats\_reporter\_alloc@{osmo\_stats\_reporter\_alloc}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_alloc()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$ osmo\+\_\+stats\+\_\+reporter\+\_\+alloc (\begin{DoxyParamCaption}\item[{enum \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+type}}]{type,  }\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::fd}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::list}, \textbf{ llist\+\_\+add\+\_\+tail()}, \textbf{ name}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::name}, \textbf{ osmo\+\_\+stats\+\_\+ctx}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+list}, \textbf{ type}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+::type}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+log()}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+statsd()}.

\mbox{\label{group__stats_ga915f63bb63276a8a98aad6c3cfac9124}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_check\_config@{osmo\_stats\_reporter\_check\_config}}
\index{osmo\_stats\_reporter\_check\_config@{osmo\_stats\_reporter\_check\_config}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_check\_config()}
{\footnotesize\ttfamily static int osmo\+\_\+stats\+\_\+reporter\+\_\+check\+\_\+config (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{unsigned int}]{index,  }\item[{int}]{class\+\_\+id }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::max\+\_\+class}, \textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+GLOBAL}, \textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+SUBSCRIBER}, and \textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+UNKNOWN}.



Referenced by \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+handler()}, and \textbf{ rate\+\_\+ctr\+\_\+handler()}.

\mbox{\label{group__stats_gaa6e7ebfa5b99d90a5b465c93c8d40175}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_create\_log@{osmo\_stats\_reporter\_create\_log}}
\index{osmo\_stats\_reporter\_create\_log@{osmo\_stats\_reporter\_create\_log}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_create\_log()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+log (\begin{DoxyParamCaption}\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



Create a stats\+\_\+reporter that logs via libosmocore logging. 

A stats\+\_\+reporter created via this function will simply print the statistics via the libosmocore logging framework, using DLSTATS subsystem and LOGL\+\_\+\+INFO priority. The configuration of the libosmocore log targets define where this information will end up (ignored, text file, stderr, syslog, ...). 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em name} & Name of the to-\/be-\/created stats\+\_\+reporter \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
stats\+\_\+reporter on success; NULL on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::have\+\_\+net\+\_\+config}, \textbf{ name}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+alloc()}, \textbf{ OSMO\+\_\+\+STATS\+\_\+\+REPORTER\+\_\+\+LOG}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send\+\_\+counter()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send\+\_\+item()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::send\+\_\+counter}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+::send\+\_\+item}.

\mbox{\label{group__stats_ga82f58af39526c20141673c7c33e8b1cc}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_create\_statsd@{osmo\_stats\_reporter\_create\_statsd}}
\index{osmo\_stats\_reporter\_create\_statsd@{osmo\_stats\_reporter\_create\_statsd}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_create\_statsd()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+statsd (\begin{DoxyParamCaption}\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



Create a stats\+\_\+reporter reporting to statsd. 

This creates a stats\+\_\+reporter instance which reports the related statistics data to statsd. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em name} & Name of the to-\/be-\/created stats\+\_\+reporter \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
stats\+\_\+reporter on success; NULL on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::close}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::have\+\_\+net\+\_\+config}, \textbf{ name}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::open}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+alloc()}, \textbf{ OSMO\+\_\+\+STATS\+\_\+\+REPORTER\+\_\+\+STATSD}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send\+\_\+counter()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send\+\_\+item()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+udp\+\_\+close()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+udp\+\_\+open()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::send\+\_\+counter}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+::send\+\_\+item}.

\mbox{\label{group__stats_ga411097be97933654c345f9fc29a27abc}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_disable@{osmo\_stats\_reporter\_disable}}
\index{osmo\_stats\_reporter\_disable@{osmo\_stats\_reporter\_disable}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_disable()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+disable (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep }\end{DoxyParamCaption})}



Disable the given stats\+\_\+reporter. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em srep} & stats\+\_\+reporter who is to be disabled \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success; negative on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::enabled}, and \textbf{ update\+\_\+srep\+\_\+config()}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+free()}.

\mbox{\label{group__stats_gad4c76af3ecaf57ea243193bf33321da8}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_enable@{osmo\_stats\_reporter\_enable}}
\index{osmo\_stats\_reporter\_enable@{osmo\_stats\_reporter\_enable}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_enable()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+enable (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep }\end{DoxyParamCaption})}



Enable the given stats\+\_\+reporter. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em srep} & stats\+\_\+reporter who is to be enabled \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success; negative on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::enabled}, and \textbf{ update\+\_\+srep\+\_\+config()}.

\mbox{\label{group__stats_ga71590de43187f692b30b3ff315f11efb}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_find@{osmo\_stats\_reporter\_find}}
\index{osmo\_stats\_reporter\_find@{osmo\_stats\_reporter\_find}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_find()}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$ osmo\+\_\+stats\+\_\+reporter\+\_\+find (\begin{DoxyParamCaption}\item[{enum \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+type}}]{type,  }\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



Find a stats\+\_\+reporter of given {\itshape type} and {\itshape name}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em type} & Type of stats\+\_\+reporter to find \\
\hline
\mbox{\texttt{ in}}  & {\em name} & Name of stats\+\_\+reporter to find \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
stats\+\_\+reporter matching {\itshape type} and {\itshape name}; NULL otherwise 
\end{DoxyReturn}


References \textbf{ list}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ name}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::name}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+list}, \textbf{ type}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+::type}.

\mbox{\label{group__stats_ga16a001641deb34a4ff7106cf00bee62b}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_free@{osmo\_stats\_reporter\_free}}
\index{osmo\_stats\_reporter\_free@{osmo\_stats\_reporter\_free}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_free()}
{\footnotesize\ttfamily void osmo\+\_\+stats\+\_\+reporter\+\_\+free (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep }\end{DoxyParamCaption})}



Destroy a given stats\+\_\+reporter. 

Takes care of first disabling it. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em srep} & stats\+\_\+reporter that shall be disabled + destroyed \\
\hline
\end{DoxyParams}


References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::list}, \textbf{ llist\+\_\+del()}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+disable()}.

\mbox{\label{group__stats_ga2fc7f059975bf4a18b32171b931a641e}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_log\_send@{osmo\_stats\_reporter\_log\_send}}
\index{osmo\_stats\_reporter\_log\_send@{osmo\_stats\_reporter\_log\_send}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_log\_send()}
{\footnotesize\ttfamily static int osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const char $\ast$}]{type,  }\item[{const char $\ast$}]{name1,  }\item[{unsigned int}]{index1,  }\item[{const char $\ast$}]{name2,  }\item[{int}]{value,  }\item[{const char $\ast$}]{unit }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ DLSTATS}, \textbf{ LOGL\+\_\+\+INFO}, \textbf{ LOGP}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::name\+\_\+prefix}, and \textbf{ type}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send\+\_\+counter()}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send\+\_\+item()}.

\mbox{\label{group__stats_gafc5d56a462747ffcd7d57fa761adf2bb}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_log\_send\_counter@{osmo\_stats\_reporter\_log\_send\_counter}}
\index{osmo\_stats\_reporter\_log\_send\_counter@{osmo\_stats\_reporter\_log\_send\_counter}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_log\_send\_counter()}
{\footnotesize\ttfamily static int osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send\+\_\+counter (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$}]{ctrg,  }\item[{const struct \textbf{ rate\+\_\+ctr\+\_\+desc} $\ast$}]{desc,  }\item[{int64\+\_\+t}]{value,  }\item[{int64\+\_\+t}]{delta }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ rate\+\_\+ctr\+\_\+group\+::desc}, \textbf{ rate\+\_\+ctr\+\_\+group\+\_\+desc\+::group\+\_\+name\+\_\+prefix}, \textbf{ rate\+\_\+ctr\+\_\+group\+::idx}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send()}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+log()}.

\mbox{\label{group__stats_gac3639eaadd98ace3c4e7c81119f85fbe}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_log\_send\_item@{osmo\_stats\_reporter\_log\_send\_item}}
\index{osmo\_stats\_reporter\_log\_send\_item@{osmo\_stats\_reporter\_log\_send\_item}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_log\_send\_item()}
{\footnotesize\ttfamily static int osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send\+\_\+item (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$}]{statg,  }\item[{const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+desc} $\ast$}]{desc,  }\item[{int64\+\_\+t}]{value }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+::desc}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+desc\+::group\+\_\+name\+\_\+prefix}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+::idx}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+log\+\_\+send()}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+log()}.

\mbox{\label{group__stats_gac75583e4c34f7749adfcc1dbd639beaa}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_sanitize\_name@{osmo\_stats\_reporter\_sanitize\_name}}
\index{osmo\_stats\_reporter\_sanitize\_name@{osmo\_stats\_reporter\_sanitize\_name}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_sanitize\_name()}
{\footnotesize\ttfamily static void osmo\+\_\+stats\+\_\+reporter\+\_\+sanitize\+\_\+name (\begin{DoxyParamCaption}\item[{char $\ast$}]{buf }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Replace all illegal \textquotesingle{}\+:\textquotesingle{} in the stats name, but not when used as value seperator. 

\textquotesingle{}\+:\textquotesingle{} is used as seperator between the name and the value in the statsd protocol. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em buf} & is a null terminated string containing name, value, unit. \\
\hline
\end{DoxyParams}


Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send()}.

\mbox{\label{group__stats_gadad3370deddae99f492506c173136a5b}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_send@{osmo\_stats\_reporter\_send}}
\index{osmo\_stats\_reporter\_send@{osmo\_stats\_reporter\_send}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_send()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+send (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const char $\ast$}]{data,  }\item[{int}]{data\+\_\+len }\end{DoxyParamCaption})}

\mbox{\label{group__stats_gad6f5b67ba5486abddbd1029bee186c74}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_send\_buffer@{osmo\_stats\_reporter\_send\_buffer}}
\index{osmo\_stats\_reporter\_send\_buffer@{osmo\_stats\_reporter\_send\_buffer}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_send\_buffer()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+send\+\_\+buffer (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep }\end{DoxyParamCaption})}



Referenced by \textbf{ flush\+\_\+all\+\_\+reporters()}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send()}.

\mbox{\label{group__stats_ga74eb80f5d3bcfdc0e720975b96dd28f6}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_send\_counter@{osmo\_stats\_reporter\_send\_counter}}
\index{osmo\_stats\_reporter\_send\_counter@{osmo\_stats\_reporter\_send\_counter}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_send\_counter()}
{\footnotesize\ttfamily static int osmo\+\_\+stats\+\_\+reporter\+\_\+send\+\_\+counter (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$}]{ctrg,  }\item[{const struct \textbf{ rate\+\_\+ctr\+\_\+desc} $\ast$}]{desc,  }\item[{int64\+\_\+t}]{value,  }\item[{int64\+\_\+t}]{delta }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::send\+\_\+counter}.



Referenced by \textbf{ handle\+\_\+counter()}, and \textbf{ rate\+\_\+ctr\+\_\+handler()}.

\mbox{\label{group__stats_gaf90de2e2999acd6d49f9c6175fa3bcbb}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_send\_item@{osmo\_stats\_reporter\_send\_item}}
\index{osmo\_stats\_reporter\_send\_item@{osmo\_stats\_reporter\_send\_item}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_send\_item()}
{\footnotesize\ttfamily static int osmo\+\_\+stats\+\_\+reporter\+\_\+send\+\_\+item (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$}]{statg,  }\item[{const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+desc} $\ast$}]{desc,  }\item[{int32\+\_\+t}]{value }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::send\+\_\+item}.



Referenced by \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+handler()}.

\mbox{\label{group__stats_ga2a07dfcee5d2d5bf13a287fc8f45adce}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_set\_flush\_period@{osmo\_stats\_reporter\_set\_flush\_period}}
\index{osmo\_stats\_reporter\_set\_flush\_period@{osmo\_stats\_reporter\_set\_flush\_period}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_set\_flush\_period()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+flush\+\_\+period (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{unsigned int}]{period }\end{DoxyParamCaption})}



Set the regular flush period for a given stats\+\_\+reporter. 

Send all stats even if they have not changed (i.\+e. force the flush) every N-\/th reporting interval. Set to 0 to disable regular flush, set to 1 to flush every time, set to 2 to flush every 2nd time, etc. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em srep} & stats\+\_\+reporter to set flush period for \\
\hline
\mbox{\texttt{ in}}  & {\em period} & Reporting interval in seconds \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success; negative on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::flush\+\_\+period}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::flush\+\_\+period\+\_\+counter}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+::force\+\_\+single\+\_\+flush}.

\mbox{\label{group__stats_gab9a3e2056ec39cb2013e8dc3da7461d9}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_set\_local\_addr@{osmo\_stats\_reporter\_set\_local\_addr}}
\index{osmo\_stats\_reporter\_set\_local\_addr@{osmo\_stats\_reporter\_set\_local\_addr}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_set\_local\_addr()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+local\+\_\+addr (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const char $\ast$}]{addr }\end{DoxyParamCaption})}

\mbox{\label{group__stats_ga510a4ce51e37e732238cf3b0ba9c5d34}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_set\_max\_class@{osmo\_stats\_reporter\_set\_max\_class}}
\index{osmo\_stats\_reporter\_set\_max\_class@{osmo\_stats\_reporter\_set\_max\_class}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_set\_max\_class()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+max\+\_\+class (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{enum \textbf{ osmo\+\_\+stats\+\_\+class}}]{class\+\_\+id }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::max\+\_\+class}, and \textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+UNKNOWN}.

\mbox{\label{group__stats_ga55a1ab6d22940d1d19356e9c5dd0f6a5}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_set\_mtu@{osmo\_stats\_reporter\_set\_mtu}}
\index{osmo\_stats\_reporter\_set\_mtu@{osmo\_stats\_reporter\_set\_mtu}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_set\_mtu()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+mtu (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{int}]{mtu }\end{DoxyParamCaption})}

\mbox{\label{group__stats_ga1be0c1ca85a6f3cac145394648e973e3}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_set\_name\_prefix@{osmo\_stats\_reporter\_set\_name\_prefix}}
\index{osmo\_stats\_reporter\_set\_name\_prefix@{osmo\_stats\_reporter\_set\_name\_prefix}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_set\_name\_prefix()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+name\+\_\+prefix (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const char $\ast$}]{prefix }\end{DoxyParamCaption})}



Set the name prefix of a given stats\+\_\+reporter. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em srep} & stats\+\_\+reporter whose name prefix is to be set \\
\hline
\mbox{\texttt{ in}}  & {\em prefix} & Name prefix to pre-\/pend for any reported value \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success; negative on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::name\+\_\+prefix}, and \textbf{ update\+\_\+srep\+\_\+config()}.

\mbox{\label{group__stats_ga898201b3f86936afe7c767e72fabd30a}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_set\_remote\_addr@{osmo\_stats\_reporter\_set\_remote\_addr}}
\index{osmo\_stats\_reporter\_set\_remote\_addr@{osmo\_stats\_reporter\_set\_remote\_addr}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_set\_remote\_addr()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+remote\+\_\+addr (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const char $\ast$}]{addr }\end{DoxyParamCaption})}

\mbox{\label{group__stats_ga34ef3e79272f99afdca7ed7c2eeaf844}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_set\_remote\_port@{osmo\_stats\_reporter\_set\_remote\_port}}
\index{osmo\_stats\_reporter\_set\_remote\_port@{osmo\_stats\_reporter\_set\_remote\_port}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_set\_remote\_port()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+remote\+\_\+port (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{int}]{port }\end{DoxyParamCaption})}

\mbox{\label{group__stats_gaae6bd21b1cd1869e42a8212b520d6375}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_statsd\_send@{osmo\_stats\_reporter\_statsd\_send}}
\index{osmo\_stats\_reporter\_statsd\_send@{osmo\_stats\_reporter\_statsd\_send}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_statsd\_send()}
{\footnotesize\ttfamily static int osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const char $\ast$}]{name1,  }\item[{const char $\ast$}]{index1,  }\item[{const char $\ast$}]{name2,  }\item[{int64\+\_\+t}]{value,  }\item[{const char $\ast$}]{unit }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::agg\+\_\+enabled}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::buffer}, \textbf{ msgb\+\_\+length()}, \textbf{ msgb\+\_\+put()}, \textbf{ msgb\+\_\+put\+\_\+u8()}, \textbf{ msgb\+\_\+tailroom()}, \textbf{ msgb\+\_\+trim()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::name\+\_\+prefix}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+sanitize\+\_\+name()}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+send\+\_\+buffer()}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send\+\_\+counter()}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send\+\_\+item()}.

\mbox{\label{group__stats_ga3a41360f016ef3c9c58fb925611b9dbb}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_statsd\_send\_counter@{osmo\_stats\_reporter\_statsd\_send\_counter}}
\index{osmo\_stats\_reporter\_statsd\_send\_counter@{osmo\_stats\_reporter\_statsd\_send\_counter}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_statsd\_send\_counter()}
{\footnotesize\ttfamily static int osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send\+\_\+counter (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$}]{ctrg,  }\item[{const struct \textbf{ rate\+\_\+ctr\+\_\+desc} $\ast$}]{desc,  }\item[{int64\+\_\+t}]{value,  }\item[{int64\+\_\+t}]{delta }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ rate\+\_\+ctr\+\_\+group\+::desc}, \textbf{ rate\+\_\+ctr\+\_\+group\+\_\+desc\+::group\+\_\+name\+\_\+prefix}, \textbf{ rate\+\_\+ctr\+\_\+group\+::idx}, \textbf{ rate\+\_\+ctr\+\_\+group\+::name}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send()}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+statsd()}.

\mbox{\label{group__stats_ga2199d156ce5a865fed49582ab3c5d9f6}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_statsd\_send\_item@{osmo\_stats\_reporter\_statsd\_send\_item}}
\index{osmo\_stats\_reporter\_statsd\_send\_item@{osmo\_stats\_reporter\_statsd\_send\_item}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_statsd\_send\_item()}
{\footnotesize\ttfamily static int osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send\+\_\+item (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep,  }\item[{const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$}]{statg,  }\item[{const struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+desc} $\ast$}]{desc,  }\item[{int64\+\_\+t}]{value }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+::desc}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+desc\+::group\+\_\+name\+\_\+prefix}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+::idx}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+::name}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+statsd\+\_\+send()}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+statsd()}.

\mbox{\label{group__stats_ga70ec5896932d94079ad55a537b7c5327}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_udp\_close@{osmo\_stats\_reporter\_udp\_close}}
\index{osmo\_stats\_reporter\_udp\_close@{osmo\_stats\_reporter\_udp\_close}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_udp\_close()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+udp\+\_\+close (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep }\end{DoxyParamCaption})}



Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+statsd()}.

\mbox{\label{group__stats_ga11fa50b5ad82e9805e8cbfa9910d3da4}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_udp\_open@{osmo\_stats\_reporter\_udp\_open}}
\index{osmo\_stats\_reporter\_udp\_open@{osmo\_stats\_reporter\_udp\_open}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_udp\_open()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+reporter\+\_\+udp\+\_\+open (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep }\end{DoxyParamCaption})}



Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+statsd()}.

\mbox{\label{group__stats_ga6b876111cf8223000e1e68aa85fa021d}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_set\_interval@{osmo\_stats\_set\_interval}}
\index{osmo\_stats\_set\_interval@{osmo\_stats\_set\_interval}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_set\_interval()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+set\+\_\+interval (\begin{DoxyParamCaption}\item[{int}]{interval }\end{DoxyParamCaption})}



Set the reporting interval (common for all reporters) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em interval} & Reporting interval in seconds \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success; negative on error 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+stats\+\_\+config\+::interval}, \textbf{ is\+\_\+initialised}, and \textbf{ start\+\_\+timer()}.

\mbox{\label{group__stats_ga355e09b1123c1271eeb5122a4b522349}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_tcp\_osmo\_fd\_register@{osmo\_stats\_tcp\_osmo\_fd\_register}}
\index{osmo\_stats\_tcp\_osmo\_fd\_register@{osmo\_stats\_tcp\_osmo\_fd\_register}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_tcp\_osmo\_fd\_register()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+tcp\+\_\+osmo\+\_\+fd\+\_\+register (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+fd} $\ast$}]{fd,  }\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



References \textbf{ ENOTSUP}.

\mbox{\label{group__stats_ga05b395c0e693d508ce0eb6bbec07a506}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_tcp\_osmo\_fd\_unregister@{osmo\_stats\_tcp\_osmo\_fd\_unregister}}
\index{osmo\_stats\_tcp\_osmo\_fd\_unregister@{osmo\_stats\_tcp\_osmo\_fd\_unregister}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_tcp\_osmo\_fd\_unregister()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+tcp\+\_\+osmo\+\_\+fd\+\_\+unregister (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+fd} $\ast$}]{fd }\end{DoxyParamCaption})}



References \textbf{ ENOTSUP}.

\mbox{\label{group__stats_ga867c62bffd27c6066a952a2b061b888b}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_tcp\_set\_interval@{osmo\_stats\_tcp\_set\_interval}}
\index{osmo\_stats\_tcp\_set\_interval@{osmo\_stats\_tcp\_set\_interval}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_tcp\_set\_interval()}
{\footnotesize\ttfamily int osmo\+\_\+stats\+\_\+tcp\+\_\+set\+\_\+interval (\begin{DoxyParamCaption}\item[{int}]{interval }\end{DoxyParamCaption})}



References \textbf{ ENOTSUP}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+init()}.

\mbox{\label{group__stats_gae722f21779b58b9cf1bafc9b4b97d8b1}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_timer\_cb@{osmo\_stats\_timer\_cb}}
\index{osmo\_stats\_timer\_cb@{osmo\_stats\_timer\_cb}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_timer\_cb()}
{\footnotesize\ttfamily static int osmo\+\_\+stats\+\_\+timer\+\_\+cb (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+fd} $\ast$}]{ofd,  }\item[{unsigned int}]{what }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ DLSTATS}, \textbf{ osmo\+\_\+fd\+::fd}, \textbf{ llist\+\_\+empty()}, \textbf{ LOGL\+\_\+\+NOTICE}, \textbf{ LOGP}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ OSMO\+\_\+\+FD\+\_\+\+READ}, \textbf{ osmo\+\_\+stats\+\_\+report()}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+list}.



Referenced by \textbf{ start\+\_\+timer()}.

\mbox{\label{group__stats_ga47631ccc3d69c5bfa3fd0c48735a6612}} 
\index{Statistics reporting@{Statistics reporting}!rate\_ctr\_group\_handler@{rate\_ctr\_group\_handler}}
\index{rate\_ctr\_group\_handler@{rate\_ctr\_group\_handler}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{rate\_ctr\_group\_handler()}
{\footnotesize\ttfamily static int rate\+\_\+ctr\+\_\+group\+\_\+handler (\begin{DoxyParamCaption}\item[{struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$}]{ctrg,  }\item[{void $\ast$}]{sctx\+\_\+ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ rate\+\_\+ctr\+\_\+for\+\_\+each\+\_\+counter()}, and \textbf{ rate\+\_\+ctr\+\_\+handler()}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+report()}.

\mbox{\label{group__stats_ga1b029e32e54b05edadbfcf4c814b12f9}} 
\index{Statistics reporting@{Statistics reporting}!rate\_ctr\_handler@{rate\_ctr\_handler}}
\index{rate\_ctr\_handler@{rate\_ctr\_handler}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{rate\_ctr\_handler()}
{\footnotesize\ttfamily static int rate\+\_\+ctr\+\_\+handler (\begin{DoxyParamCaption}\item[{struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$}]{ctrg,  }\item[{struct \textbf{ rate\+\_\+ctr} $\ast$}]{ctr,  }\item[{const struct \textbf{ rate\+\_\+ctr\+\_\+desc} $\ast$}]{desc,  }\item[{void $\ast$}]{sctx\+\_\+ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ rate\+\_\+ctr\+\_\+group\+\_\+desc\+::class\+\_\+id}, \textbf{ rate\+\_\+ctr\+::current}, \textbf{ rate\+\_\+ctr\+\_\+group\+::desc}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::force\+\_\+single\+\_\+flush}, \textbf{ rate\+\_\+ctr\+\_\+group\+::idx}, \textbf{ list}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+check\+\_\+config()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+list}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+send\+\_\+counter()}, \textbf{ rate\+\_\+ctr\+\_\+difference()}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+::running}.



Referenced by \textbf{ rate\+\_\+ctr\+\_\+group\+\_\+handler()}.

\mbox{\label{group__stats_gaf99f98cfd0da9f59b9e490bf04b12100}} 
\index{Statistics reporting@{Statistics reporting}!start\_timer@{start\_timer}}
\index{start\_timer@{start\_timer}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{start\_timer()}
{\footnotesize\ttfamily static int start\+\_\+timer (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ DLSTATS}, \textbf{ osmo\+\_\+fd\+::fd}, \textbf{ osmo\+\_\+stats\+\_\+config\+::interval}, \textbf{ is\+\_\+initialised}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGL\+\_\+\+INFO}, \textbf{ LOGP}, \textbf{ osmo\+\_\+stats\+\_\+timer}, \textbf{ osmo\+\_\+stats\+\_\+timer\+\_\+cb()}, \textbf{ osmo\+\_\+timerfd\+\_\+disable()}, \textbf{ osmo\+\_\+timerfd\+\_\+schedule()}, and \textbf{ osmo\+\_\+timerfd\+\_\+setup()}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+init()}, and \textbf{ osmo\+\_\+stats\+\_\+set\+\_\+interval()}.

\mbox{\label{group__stats_gab7df28b2e32b2437bfc88185a1a5c06f}} 
\index{Statistics reporting@{Statistics reporting}!update\_srep\_config@{update\_srep\_config}}
\index{update\_srep\_config@{update\_srep\_config}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{update\_srep\_config()}
{\footnotesize\ttfamily static int update\+\_\+srep\+\_\+config (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$}]{srep }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+stats\+\_\+reporter\+::close}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::enabled}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::force\+\_\+single\+\_\+flush}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+::open}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+::running}.



Referenced by \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+disable()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+enable()}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+name\+\_\+prefix()}.



\doxysubsection{Variable Documentation}
\mbox{\label{group__stats_ga7f43ce07ecb101dec32db3ff82597024}} 
\index{Statistics reporting@{Statistics reporting}!is\_initialised@{is\_initialised}}
\index{is\_initialised@{is\_initialised}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{is\_initialised}
{\footnotesize\ttfamily int is\+\_\+initialised = 0\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ osmo\+\_\+stats\+\_\+init()}, \textbf{ osmo\+\_\+stats\+\_\+set\+\_\+interval()}, and \textbf{ start\+\_\+timer()}.

\mbox{\label{group__stats_ga69cc1eef57bf721fad3eb0b08b44231a}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_config@{osmo\_stats\_config}}
\index{osmo\_stats\_config@{osmo\_stats\_config}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_config\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stats\+\_\+config}$\ast$ \textbf{ osmo\+\_\+stats\+\_\+config}\hspace{0.3cm}{\ttfamily [extern]}}

\mbox{\label{group__stats_ga69cc1eef57bf721fad3eb0b08b44231a}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_config@{osmo\_stats\_config}}
\index{osmo\_stats\_config@{osmo\_stats\_config}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_config\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stats\+\_\+config}$\ast$ \textbf{ osmo\+\_\+stats\+\_\+config} = \&\textbf{ s\+\_\+stats\+\_\+config}}

\mbox{\label{group__stats_ga4e0b725ba99e4703c4d886dacda2557b}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_ctx@{osmo\_stats\_ctx}}
\index{osmo\_stats\_ctx@{osmo\_stats\_ctx}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_ctx}
{\footnotesize\ttfamily void$\ast$ osmo\+\_\+stats\+\_\+ctx = NULL\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ osmo\+\_\+stats\+\_\+init()}, and \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+alloc()}.

\mbox{\label{group__stats_gaef85c887394f0465c12a1fe46dfee1b1}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_reporter\_list@{osmo\_stats\_reporter\_list}}
\index{osmo\_stats\_reporter\_list@{osmo\_stats\_reporter\_list}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_reporter\_list}
{\footnotesize\ttfamily struct \textbf{ llist\+\_\+head} osmo\+\_\+stats\+\_\+reporter\+\_\+list\hspace{0.3cm}{\ttfamily [extern]}}



Referenced by \textbf{ flush\+\_\+all\+\_\+reporters()}, \textbf{ handle\+\_\+counter()}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+handler()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+alloc()}, \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+find()}, \textbf{ osmo\+\_\+stats\+\_\+timer\+\_\+cb()}, and \textbf{ rate\+\_\+ctr\+\_\+handler()}.

\mbox{\label{group__stats_ga54c4286630b9ee36ce26a8a71b5d3420}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_stats\_timer@{osmo\_stats\_timer}}
\index{osmo\_stats\_timer@{osmo\_stats\_timer}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_stats\_timer}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+fd} osmo\+\_\+stats\+\_\+timer = \{ .fd = -\/1 \}\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ start\+\_\+timer()}.

\mbox{\label{group__stats_ga240c607283cc0da3b2f1732fa54b6ca6}} 
\index{Statistics reporting@{Statistics reporting}!osmo\_tcp\_stats\_config@{osmo\_tcp\_stats\_config}}
\index{osmo\_tcp\_stats\_config@{osmo\_tcp\_stats\_config}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{osmo\_tcp\_stats\_config}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+tcp\+\_\+stats\+\_\+config}$\ast$ \textbf{ osmo\+\_\+tcp\+\_\+stats\+\_\+config} = \&\textbf{ s\+\_\+tcp\+\_\+stats\+\_\+config}}

\mbox{\label{group__stats_gaf5364d1732312969d6ade23325ce1493}} 
\index{Statistics reporting@{Statistics reporting}!s\_stats\_config@{s\_stats\_config}}
\index{s\_stats\_config@{s\_stats\_config}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{s\_stats\_config}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stats\+\_\+config} s\+\_\+stats\+\_\+config\hspace{0.3cm}{\ttfamily [static]}}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .interval = STATS\_DEFAULT\_INTERVAL,}
\DoxyCodeLine{\}}

\end{DoxyCode}
\mbox{\label{group__stats_ga93f90d34c7469d7f3a5bfb46c03e9bc2}} 
\index{Statistics reporting@{Statistics reporting}!s\_tcp\_stats\_config@{s\_tcp\_stats\_config}}
\index{s\_tcp\_stats\_config@{s\_tcp\_stats\_config}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{s\_tcp\_stats\_config}
{\footnotesize\ttfamily struct \textbf{ osmo\+\_\+tcp\+\_\+stats\+\_\+config} s\+\_\+tcp\+\_\+stats\+\_\+config\hspace{0.3cm}{\ttfamily [static]}}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .interval = TCP\_STATS\_DEFAULT\_INTERVAL,}
\DoxyCodeLine{\}}

\end{DoxyCode}
