ccnr_stats.c File Reference

Statistics presentation for ccnr. More...

Go to the source code of this file.

Defines

#define CRLF   "\r\n"
#define NL   "\n"

Functions

static int ccnr_collect_stats (struct ccnr_handle *h, struct ccnr_stats *ans)
static struct ccn_charbufcollect_stats_html (struct ccnr_handle *h)
static void send_http_response (struct ccnr_handle *h, struct fdholder *fdholder, const char *mime_type, struct ccn_charbuf *response)
static struct ccn_charbufcollect_stats_xml (struct ccnr_handle *h)
static void ccnr_stats_http_set_debug (struct ccnr_handle *h, struct fdholder *fdholder, int level)
int ccnr_stats_handle_http_connection (struct ccnr_handle *h, struct fdholder *fdholder)
static void collect_faces_html (struct ccnr_handle *h, struct ccn_charbuf *b)
static void collect_face_meter_html (struct ccnr_handle *h, struct ccn_charbuf *b)
static void collect_forwarding_html (struct ccnr_handle *h, struct ccn_charbuf *b)
static unsigned ccnr_colorhash (struct ccnr_handle *h)
static void collect_meter_xml (struct ccnr_handle *h, struct ccn_charbuf *b, struct ccnr_meter *m)
static void collect_faces_xml (struct ccnr_handle *h, struct ccn_charbuf *b)
static void collect_forwarding_xml (struct ccnr_handle *h, struct ccn_charbuf *b)
struct ccnr_meter * ccnr_meter_create (struct ccnr_handle *h, const char *what)
 create and initialize separately allocated meter.
void ccnr_meter_destroy (struct ccnr_meter **pm)
 Destroy a separately allocated meter.
void ccnr_meter_init (struct ccnr_handle *h, struct ccnr_meter *m, const char *what)
 Initialize a meter.
void ccnr_meter_bump (struct ccnr_handle *h, struct ccnr_meter *m, unsigned amt)
 Count something (messages, packets, bytes), and roll up some kind of statistics on it.
unsigned ccnr_meter_rate (struct ccnr_handle *h, struct ccnr_meter *m)
 Return the average rate (units per second) of a metered quantity.
uintmax_t ccnr_meter_total (struct ccnr_meter *m)
 Return the grand total for a metered quantity.

Variables

static const char * resp404
static const char * resp405
static const unsigned meterHz = 7


Detailed Description

Statistics presentation for ccnr.

Part of ccnr - CCNx Repository Daemon.

Definition in file ccnr_stats.c.


Define Documentation

#define CRLF   "\r\n"

Definition at line 53 of file ccnr_stats.c.

#define NL   "\n"

Definition at line 54 of file ccnr_stats.c.


Function Documentation

static int ccnr_collect_stats ( struct ccnr_handle h,
struct ccnr_stats *  ans 
) [static]

Definition at line 185 of file ccnr_stats.c.

Referenced by collect_stats_html(), and collect_stats_xml().

static unsigned ccnr_colorhash ( struct ccnr_handle h  )  [static]

Definition at line 351 of file ccnr_stats.c.

Referenced by collect_stats_html().

void ccnr_meter_bump ( struct ccnr_handle h,
struct ccnr_meter *  m,
unsigned  amt 
)

Count something (messages, packets, bytes), and roll up some kind of statistics on it.

Definition at line 645 of file ccnr_stats.c.

Referenced by ccnr_meter_init(), ccnr_meter_rate(), process_incoming_content(), r_dispatch_process_input(), r_dispatch_process_internal_client_buffer(), r_io_send(), and r_link_send_content().

struct ccnr_meter* ccnr_meter_create ( struct ccnr_handle h,
const char *  what 
) [read]

create and initialize separately allocated meter.

Definition at line 602 of file ccnr_stats.c.

Referenced by r_io_enroll_face().

void ccnr_meter_destroy ( struct ccnr_meter **  pm  ) 

Destroy a separately allocated meter.

Definition at line 616 of file ccnr_stats.c.

Referenced by r_io_shutdown_client_fd().

void ccnr_meter_init ( struct ccnr_handle h,
struct ccnr_meter *  m,
const char *  what 
)

Initialize a meter.

Definition at line 628 of file ccnr_stats.c.

Referenced by ccnr_meter_create().

unsigned ccnr_meter_rate ( struct ccnr_handle h,
struct ccnr_meter *  m 
)

Return the average rate (units per second) of a metered quantity.

m may be NULL.

Definition at line 672 of file ccnr_stats.c.

Referenced by collect_face_meter_html(), and collect_meter_xml().

uintmax_t ccnr_meter_total ( struct ccnr_meter *  m  ) 

Return the grand total for a metered quantity.

m may be NULL.

Definition at line 689 of file ccnr_stats.c.

Referenced by collect_meter_xml(), and r_store_reindexing().

int ccnr_stats_handle_http_connection ( struct ccnr_handle h,
struct fdholder fdholder 
)

Definition at line 103 of file ccnr_stats.c.

Referenced by r_dispatch_process_input().

static void ccnr_stats_http_set_debug ( struct ccnr_handle h,
struct fdholder fdholder,
int  level 
) [static]

Definition at line 90 of file ccnr_stats.c.

Referenced by ccnr_stats_handle_http_connection().

static void collect_face_meter_html ( struct ccnr_handle h,
struct ccn_charbuf b 
) [static]

Definition at line 273 of file ccnr_stats.c.

static void collect_faces_html ( struct ccnr_handle h,
struct ccn_charbuf b 
) [static]

Definition at line 227 of file ccnr_stats.c.

static void collect_faces_xml ( struct ccnr_handle h,
struct ccn_charbuf b 
) [static]

Definition at line 447 of file ccnr_stats.c.

static void collect_forwarding_html ( struct ccnr_handle h,
struct ccn_charbuf b 
) [static]

Definition at line 306 of file ccnr_stats.c.

static void collect_forwarding_xml ( struct ccnr_handle h,
struct ccn_charbuf b 
) [static]

Definition at line 495 of file ccnr_stats.c.

static void collect_meter_xml ( struct ccnr_handle h,
struct ccn_charbuf b,
struct ccnr_meter *  m 
) [static]

Definition at line 433 of file ccnr_stats.c.

static struct ccn_charbuf * collect_stats_html ( struct ccnr_handle h  )  [static, read]

Definition at line 361 of file ccnr_stats.c.

static struct ccn_charbuf * collect_stats_xml ( struct ccnr_handle h  )  [static, read]

Definition at line 540 of file ccnr_stats.c.

static void send_http_response ( struct ccnr_handle h,
struct fdholder fdholder,
const char *  mime_type,
struct ccn_charbuf response 
) [static]

Definition at line 162 of file ccnr_stats.c.


Variable Documentation

const unsigned meterHz = 7 [static]

Definition at line 638 of file ccnr_stats.c.

const char* resp404 [static]

Initial value:

    "HTTP/1.1 404 Not Found" CRLF
    "Connection: close" CRLF CRLF

Definition at line 81 of file ccnr_stats.c.

const char* resp405 [static]

Initial value:

    "HTTP/1.1 405 Method Not Allowed" CRLF
    "Connection: close" CRLF CRLF

Definition at line 85 of file ccnr_stats.c.


Generated on Thu Feb 16 00:44:07 2012 for Content-Centric Networking in C by  doxygen 1.5.6