\doxysection{Statistics reporting}
\label{group__stats}\index{Statistics reporting@{Statistics reporting}}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum {\bfseries osmo\+\_\+stats\+\_\+class} 
\item 
enum {\bfseries osmo\+\_\+stats\+\_\+reporter\+\_\+type} 
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ osmo\+\_\+stats\+\_\+init} (void $\ast$ctx)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+report} (void)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+set\+\_\+interval} (int interval)
\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)
\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})
\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)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+enable} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+disable} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+set\+\_\+flush\+\_\+period} (struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$srep, unsigned int period)
\item 
struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$ \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+log} (const char $\ast$\textbf{ name})
\item 
struct \textbf{ osmo\+\_\+stats\+\_\+reporter} $\ast$ \textbf{ osmo\+\_\+stats\+\_\+reporter\+\_\+create\+\_\+statsd} (const char $\ast$\textbf{ name})
\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)
\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 
static \textbf{ LLIST\+\_\+\+HEAD} (\textbf{ stats\+\_\+tcp})
\item 
static void \textbf{ fill\+\_\+stats} (struct \textbf{ stats\+\_\+tcp\+\_\+entry} $\ast$\textbf{ stats\+\_\+tcp\+\_\+entry})
\item 
static bool \textbf{ is\+\_\+tcp} (const struct \textbf{ osmo\+\_\+fd} $\ast$\textbf{ fd})
\item 
int \textbf{ osmo\+\_\+stats\+\_\+tcp\+\_\+osmo\+\_\+fd\+\_\+register} (const struct \textbf{ osmo\+\_\+fd} $\ast$\textbf{ fd}, const char $\ast$\textbf{ name})
\item 
static void \textbf{ next\+\_\+stats\+\_\+tcp\+\_\+entry} (void)
\item 
int \textbf{ osmo\+\_\+stats\+\_\+tcp\+\_\+osmo\+\_\+fd\+\_\+unregister} (const struct \textbf{ osmo\+\_\+fd} $\ast$\textbf{ fd})
\item 
static void \textbf{ stats\+\_\+tcp\+\_\+poll\+\_\+timer\+\_\+cb} (void $\ast$\textbf{ data})
\item 
int \textbf{ osmo\+\_\+stats\+\_\+tcp\+\_\+set\+\_\+interval} (int interval)
\item 
static \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+} ((constructor))
\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)
\begin{DoxyCompactList}\small\item\em print a stat item group to given VTY \end{DoxyCompactList}\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)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+UNKNOWN}
\item 
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+GLOBAL}
\item 
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+PEER}
\item 
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+CLASS\+\_\+\+SUBSCRIBER}
\item 
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+REPORTER\+\_\+\+LOG}
\item 
\textbf{ OSMO\+\_\+\+STATS\+\_\+\+REPORTER\+\_\+\+STATSD}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+UNACKED}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+LOST}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+RETRANS}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+RTT}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+RCV\+\_\+\+RTT}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+NOTSENT\+\_\+\+BYTES}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+RWND\+\_\+\+LIMITED}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+SNDBUF\+\_\+\+LIMITED}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+REORD\+\_\+\+SEEN}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+UNACKED}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+LOST}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+RETRANS}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+RTT}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+RCV\+\_\+\+RTT}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+NOTSENT\+\_\+\+BYTES}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+RWND\+\_\+\+LIMITED}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+SNDBUF\+\_\+\+LIMITED}
\item 
\textbf{ STATS\+\_\+\+TCP\+\_\+\+REORD\+\_\+\+SEEN}
\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}
\item 
static int \textbf{ is\+\_\+initialised}
\item 
static struct \textbf{ osmo\+\_\+stats\+\_\+config} \textbf{ s\+\_\+stats\+\_\+config}
\item 
struct \textbf{ osmo\+\_\+stats\+\_\+config} $\ast$ \textbf{ osmo\+\_\+stats\+\_\+config}
\item 
static struct \textbf{ osmo\+\_\+fd} \textbf{ osmo\+\_\+stats\+\_\+timer}
\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}
\item 
static struct \textbf{ osmo\+\_\+timer\+\_\+list} \textbf{ stats\+\_\+tcp\+\_\+poll\+\_\+timer}
\item 
static struct \textbf{ stats\+\_\+tcp\+\_\+entry} $\ast$ \textbf{ stats\+\_\+tcp\+\_\+entry\+\_\+cur}
\item 
pthread\+\_\+mutex\+\_\+t \textbf{ stats\+\_\+tcp\+\_\+lock}
\item 
struct \textbf{ llist\+\_\+head} \textbf{ entry}
\item 
const struct \textbf{ osmo\+\_\+fd} $\ast$ \textbf{ fd}
\item 
struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$ \textbf{ stats\+\_\+tcp}
\item 
const char $\ast$ \textbf{ name}
\item 
static struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+desc} \textbf{ stats\+\_\+tcp\+\_\+item\+\_\+desc} [$\,$]
\item 
static struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+desc} \textbf{ stats\+\_\+tcp\+\_\+desc}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


\doxysubsection{Function Documentation}
\mbox{\label{group__stats_gafff519726c5ed78b596cc9e5065bedab}} 
\index{Statistics reporting@{Statistics reporting}!vty\_out\_stat\_item\_group@{vty\_out\_stat\_item\_group}}
\index{vty\_out\_stat\_item\_group@{vty\_out\_stat\_item\_group}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{vty\_out\_stat\_item\_group()}
{\footnotesize\ttfamily void vty\+\_\+out\+\_\+stat\+\_\+item\+\_\+group (\begin{DoxyParamCaption}\item[{struct \textbf{ vty} $\ast$}]{vty,  }\item[{const char $\ast$}]{prefix,  }\item[{struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$}]{statg }\end{DoxyParamCaption})}



References \textbf{ vty\+\_\+out\+\_\+context\+::prefix}, and \textbf{ vty\+\_\+out\+\_\+stat\+\_\+item\+\_\+group2()}.

\mbox{\label{group__stats_ga866d63e6c3678474717b4971c4713232}} 
\index{Statistics reporting@{Statistics reporting}!vty\_out\_stat\_item\_group2@{vty\_out\_stat\_item\_group2}}
\index{vty\_out\_stat\_item\_group2@{vty\_out\_stat\_item\_group2}!Statistics reporting@{Statistics reporting}}
\doxysubsubsection{vty\_out\_stat\_item\_group2()}
{\footnotesize\ttfamily void vty\+\_\+out\+\_\+stat\+\_\+item\+\_\+group2 (\begin{DoxyParamCaption}\item[{struct \textbf{ vty} $\ast$}]{vty,  }\item[{const char $\ast$}]{prefix,  }\item[{struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$}]{statg,  }\item[{bool}]{skip\+\_\+zero }\end{DoxyParamCaption})}



print a stat item group to given VTY 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em vty} & The VTY to which it should be printed \\
\hline
\mbox{\texttt{ in}}  & {\em prefix} & Any additional log prefix ahead of each line \\
\hline
\mbox{\texttt{ in}}  & {\em statg} & Stat item group to be printed \\
\hline
\mbox{\texttt{ in}}  & {\em skip\+\_\+zero} & Skip all zero-\/valued counters \\
\hline
\end{DoxyParams}


References \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+::desc}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+desc\+::group\+\_\+description}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+for\+\_\+each\+\_\+item()}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+handler()}, \textbf{ vty\+\_\+out\+\_\+context\+::prefix}, \textbf{ vty\+\_\+out\+\_\+context\+::skip\+\_\+zero}, \textbf{ vty}, \textbf{ VTY\+\_\+\+NEWLINE}, and \textbf{ vty\+\_\+out()}.



Referenced by \textbf{ vty\+\_\+out\+\_\+stat\+\_\+item\+\_\+group()}.

