ccnd_stats.c File Reference

Statistics presentation for ccnd. More...

Go to the source code of this file.

Defines

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

Functions

static int ccnd_collect_stats (struct ccnd_handle *h, struct ccnd_stats *ans)
static struct ccn_charbufcollect_stats_html (struct ccnd_handle *h)
static void send_http_response (struct ccnd_handle *h, struct face *face, const char *mime_type, struct ccn_charbuf *response)
static struct ccn_charbufcollect_stats_xml (struct ccnd_handle *h)
static void ccnd_stats_http_set_debug (struct ccnd_handle *h, struct face *face, int level)
int ccnd_stats_handle_http_connection (struct ccnd_handle *h, struct face *face)
static void collect_faces_html (struct ccnd_handle *h, struct ccn_charbuf *b)
static void collect_face_meter_html (struct ccnd_handle *h, struct ccn_charbuf *b)
static void collect_forwarding_html (struct ccnd_handle *h, struct ccn_charbuf *b)
static unsigned ccnd_colorhash (struct ccnd_handle *h)
static void collect_meter_xml (struct ccnd_handle *h, struct ccn_charbuf *b, struct ccnd_meter *m)
static void collect_faces_xml (struct ccnd_handle *h, struct ccn_charbuf *b)
static void collect_forwarding_xml (struct ccnd_handle *h, struct ccn_charbuf *b)
struct ccnd_meter * ccnd_meter_create (struct ccnd_handle *h, const char *what)
 create and initialize separately allocated meter.
void ccnd_meter_destroy (struct ccnd_meter **pm)
 Destroy a separately allocated meter.
void ccnd_meter_init (struct ccnd_handle *h, struct ccnd_meter *m, const char *what)
 Initialize a meter.
void ccnd_meter_bump (struct ccnd_handle *h, struct ccnd_meter *m, unsigned amt)
 Count something (messages, packets, bytes), and roll up some kind of statistics on it.
unsigned ccnd_meter_rate (struct ccnd_handle *h, struct ccnd_meter *m)
 Return the average rate (units per second) of a metered quantity.
uintmax_t ccnd_meter_total (struct ccnd_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 ccnd.

Part of ccnd - the CCNx Daemon.

Copyright (C) 2008-2011 Palo Alto Research Center, Inc.

This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This work is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Definition in file ccnd_stats.c.


Define Documentation

#define CRLF   "\r\n"

Definition at line 46 of file ccnd_stats.c.

Referenced by ccnd_stats_http_set_debug(), main(), and send_http_response().

#define NL   "\n"

Function Documentation

static int ccnd_collect_stats ( struct ccnd_handle h,
struct ccnd_stats *  ans 
) [static]

Definition at line 178 of file ccnd_stats.c.

Referenced by collect_stats_html(), and collect_stats_xml().

static unsigned ccnd_colorhash ( struct ccnd_handle h  )  [static]

Definition at line 349 of file ccnd_stats.c.

Referenced by collect_stats_html().

void ccnd_meter_bump ( struct ccnd_handle h,
struct ccnd_meter *  m,
unsigned  amt 
)

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

Definition at line 647 of file ccnd_stats.c.

Referenced by ccn_stuff_interest(), ccnd_meter_init(), ccnd_meter_rate(), ccnd_send(), do_propagate(), process_incoming_content(), process_incoming_interest(), process_input(), process_internal_client_buffer(), send_content(), and stuff_link_check().

struct ccnd_meter* ccnd_meter_create ( struct ccnd_handle h,
const char *  what 
) [read]

create and initialize separately allocated meter.

Definition at line 604 of file ccnd_stats.c.

Referenced by enroll_face().

void ccnd_meter_destroy ( struct ccnd_meter **  pm  ) 

Destroy a separately allocated meter.

Definition at line 618 of file ccnd_stats.c.

Referenced by finalize_face().

void ccnd_meter_init ( struct ccnd_handle h,
struct ccnd_meter *  m,
const char *  what 
)

Initialize a meter.

Definition at line 630 of file ccnd_stats.c.

Referenced by ccnd_meter_create().

unsigned ccnd_meter_rate ( struct ccnd_handle h,
struct ccnd_meter *  m 
)

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

m may be NULL.

Definition at line 674 of file ccnd_stats.c.

Referenced by collect_face_meter_html(), and collect_meter_xml().

uintmax_t ccnd_meter_total ( struct ccnd_meter *  m  ) 

Return the grand total for a metered quantity.

m may be NULL.

Definition at line 691 of file ccnd_stats.c.

Referenced by collect_meter_xml().

int ccnd_stats_handle_http_connection ( struct ccnd_handle h,
struct face face 
)

Definition at line 96 of file ccnd_stats.c.

Referenced by process_input().

static void ccnd_stats_http_set_debug ( struct ccnd_handle h,
struct face face,
int  level 
) [static]

Definition at line 83 of file ccnd_stats.c.

Referenced by ccnd_stats_handle_http_connection().

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

Definition at line 271 of file ccnd_stats.c.

Referenced by collect_stats_html().

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

Definition at line 220 of file ccnd_stats.c.

Referenced by collect_stats_html().

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

Definition at line 453 of file ccnd_stats.c.

Referenced by collect_stats_xml().

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

Definition at line 304 of file ccnd_stats.c.

Referenced by collect_stats_html().

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

Definition at line 497 of file ccnd_stats.c.

Referenced by collect_stats_xml().

static void collect_meter_xml ( struct ccnd_handle h,
struct ccn_charbuf b,
struct ccnd_meter *  m 
) [static]

Definition at line 439 of file ccnd_stats.c.

Referenced by collect_faces_xml().

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

Definition at line 359 of file ccnd_stats.c.

Referenced by ccnd_stats_handle_http_connection().

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

Definition at line 542 of file ccnd_stats.c.

Referenced by ccnd_stats_handle_http_connection().

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

Definition at line 155 of file ccnd_stats.c.

Referenced by ccnd_stats_handle_http_connection(), and ccnd_stats_http_set_debug().


Variable Documentation

const unsigned meterHz = 7 [static]

Definition at line 640 of file ccnd_stats.c.

Referenced by ccnd_meter_bump(), and ccnd_meter_rate().

const char* resp404 [static]
Initial value:
    "HTTP/1.1 404 Not Found" CRLF
    "Connection: close" CRLF CRLF

Definition at line 74 of file ccnd_stats.c.

Referenced by ccnd_stats_handle_http_connection().

const char* resp405 [static]
Initial value:
    "HTTP/1.1 405 Method Not Allowed" CRLF
    "Connection: close" CRLF CRLF

Definition at line 78 of file ccnd_stats.c.

Referenced by ccnd_stats_handle_http_connection().

Generated on Fri May 13 16:27:08 2011 for Content-Centric Networking in C by  doxygen 1.6.3