CCNx-Android-Services/jni/csrc/ccnr/ccnr_stats.c File Reference

Statistics presentation for ccnr. More...

#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/utsname.h>
#include <time.h>
#include <unistd.h>
#include <ccn/ccn.h>
#include <ccn/charbuf.h>
#include <ccn/coding.h>
#include <ccn/indexbuf.h>
#include <ccn/schedule.h>
#include <ccn/sockaddrutil.h>
#include <ccn/hashtb.h>
#include <ccn/uri.h>
#include "ccnr_private.h"
#include "ccnr_stats.h"
#include "ccnr_io.h"
#include "ccnr_msg.h"

Classes

struct  ccnr_meter
 Provide a way to monitor rates. More...
struct  ccnr_stats

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_charbuf * collect_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_charbuf * collect_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_meterccnr_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.


Function Documentation

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.

uintmax_t ccnr_meter_total ( struct ccnr_meter m  ) 

Return the grand total for a metered quantity.

m may be NULL.


Variable Documentation

const char* resp404 [static]

Initial value:

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

const char* resp405 [static]

Initial value:

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


Generated on Thu Feb 16 00:45:13 2012 for CCNx for Android by  doxygen 1.5.6