modules/seas/statistics.h File Reference

#include <sys/time.h>
#include <time.h>
#include "../../hash_func.h"
#include "../../locking.h"
#include "../tm/h_table.h"

Include dependency graph for modules/seas/statistics.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  statscell
struct  statstable

Defines

#define receivedplus()
#define STATS_CELLS   50
#define UAC_T   1
#define UAS_T   0

Functions

void action_stat (struct cell *t)
void as_relay_stat (struct cell *t)
void destroy_seas_stats_table (void)
void event_stat (struct cell *t)
struct statstableinit_seas_stats_table (void)
int print_stats_info (int f, int sock)
void serve_stats (int fd)
int start_stats_server (char *socket)
void stats_reply (void)
int stop_stats_server (void)

Variables

struct statstableseas_stats_table


Define Documentation

 
#define receivedplus (  ) 

Value:

do{ \
      lock_get(seas_stats_table->mutex); \
      seas_stats_table->received++; \
      lock_release(seas_stats_table->mutex); \
   }while(0)

Definition at line 88 of file modules/seas/statistics.h.

Referenced by process_input().

#define STATS_CELLS   50

Definition at line 27 of file modules/seas/statistics.h.

#define UAC_T   1

Definition at line 29 of file modules/seas/statistics.h.

#define UAS_T   0

Definition at line 28 of file modules/seas/statistics.h.

Referenced by as_relay_stat().


Function Documentation

void action_stat ( struct cell t  )  [inline]

this will be called from the SEAS action dispatcher when it receives the action from the socket

no statistics found

Definition at line 170 of file modules/seas/statistics.c.

References totag_elem::acked, assignIndex(), statstable::dispatch, statstable::event, statstable::finished_transactions, cell::fwded_totags, LM_DBG, statstable::mutex, totag_elem::next, NULL, _str::s, s, STATS_PAY, totag_elem::tag, statscell::u, and statscell::uas.

Referenced by ac_reply().

void as_relay_stat ( struct cell t  )  [inline]

Statistics functions

This will be called from within w_as_relay()

TODO handle locking ?

Definition at line 96 of file modules/seas/statistics.c.

References totag_elem::acked, cell::fwded_totags, _str::len, LM_DBG, statstable::mutex, totag_elem::next, NULL, _str::s, s, shm_free, shm_malloc(), statstable::started_transactions, STATS_PAY, totag_elem::tag, statscell::type, statscell::u, statscell::uas, and UAS_T.

Referenced by w_as_relay_sl(), and w_as_relay_t().

void destroy_seas_stats_table ( void   )  [inline]

Definition at line 82 of file modules/seas/statistics.c.

References statstable::mutex, and shm_free.

Referenced by sig_handler(), and start_stats_server().

void event_stat ( struct cell t  )  [inline]

this will be called from the SEAS event dispatcher when it writes the event to the socket

Parameters: a cell OR its hash_index and its label

TODO handle locking/mutexing ?

Definition at line 134 of file modules/seas/statistics.c.

References totag_elem::acked, cell::fwded_totags, LM_DBG, totag_elem::next, NULL, _str::s, s, STATS_PAY, totag_elem::tag, statscell::u, and statscell::uas.

Referenced by dispatch_relay().

struct statstable* init_seas_stats_table ( void   )  [read]

Initialize and destroy statistics table

Definition at line 64 of file modules/seas/statistics.c.

References LM_ERR, statstable::mutex, shm_free, and shm_malloc().

Referenced by start_stats_server().

int print_stats_info ( int  f,
int  sock 
) [inline]

(from snprintf manual) "The functions snprintf() and vsnprintf() do not write more than size bytes (including the trailing '\0'). If the output was truncated due to this limit then the return value is the number of characters (not including the trailing '\0') which would have been written to the final string if enough space had been available. Thus, a return value of size or more means that the output was truncated."

Definition at line 371 of file modules/seas/statistics.c.

References buf, statstable::dispatch, statstable::event, statstable::finished_transactions, statstable::mutex, statstable::received, statstable::received_replies, snprintf, statstable::started_transactions, and STATS_BUF_SIZE.

Referenced by serve_stats().

void serve_stats ( int  fd  ) 

Statistics server process functions

and continue accept()'ing

simple error happened, dont worry

let's go to the outer loop, and receive more Statistics clients

Definition at line 313 of file modules/seas/statistics.c.

References LM_ERR, print_stats_info(), sockaddr_union::s, sig_handler(), and sock.

Referenced by start_stats_server().

int start_stats_server ( char *  stats_socket  ) 

stats socket sould be an IP_address:port or unix://path/to_file TODO handling unix sockets and IPv6 !!

returns 0 if no stats 1 if stats properly started -1 if error

Definition at line 220 of file modules/seas/statistics.c.

References destroy_seas_stats_table(), init_seas_stats_table(), LM_ERR, pid, port, resolvehost(), serve_stats(), sig_handler(), stats_fd, str2s(), and use_stats.

Referenced by seas_init().

void stats_reply ( void   )  [inline]

Definition at line 443 of file modules/seas/statistics.c.

References statstable::mutex, and statstable::received_replies.

Referenced by process_action().

int stop_stats_server ( void   )  [inline]

stats socket sould be an IP_address:port or unix://path/to_file TODO handling unix sockets and IPv6 !!

returns 0 if no stats 1 if stats properly started -1 if error

Definition at line 306 of file modules/seas/statistics.c.

References pid.

Referenced by seas_init().


Variable Documentation

Definition at line 45 of file modules/seas/statistics.c.


Generated on Wed May 23 20:00:44 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6