My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Macros | Functions | Variables
controller_stats.c File Reference
#include "controller_stats.h"
#include "timeseries.h"
#include "stats.h"
#include "logging.h"
#include "controller_mysql.h"
#include "controller_dfg.h"
#include "stat_msg_handler.h"
#include <stdbool.h>

Go to the source code of this file.

Classes

struct  stat_type
 The structure holding all items of a type of stats. More...
 

Macros

#define N_STAT_TYPES   sizeof(stat_types) / sizeof(*stat_types)
 
#define CHECK_INIT
 

Functions

static struct stat_typeget_stat_type (enum stat_id id)
 
static struct timed_rrdbget_stat (enum stat_id id, unsigned int item_id)
 
struct timed_rrdbget_thread_stat (enum stat_id id, unsigned int runtime_id, unsigned int thread_id)
 
struct timed_rrdbget_msu_stat (enum stat_id id, unsigned int msu_id)
 
static int unregister_stat (enum stat_id stat_id, unsigned int item_id)
 
int unregister_msu_stats (unsigned int msu_id)
 
int unregister_thread_stats (unsigned int thread_id, unsigned int runtime_id)
 
int register_stat (enum stat_id stat_id, unsigned int item_id)
 
int register_msu_stats (unsigned int msu_id, int msu_type_id, int thread_id, int runtime_id)
 
int register_thread_stats (unsigned int thread_id, unsigned int runtime_id)
 
int init_statistics ()
 Initializes the entire stats module. More...
 
void show_stats (struct dfg_msu *msu)
 

Variables

static struct stat_type stat_types []
 
static bool stats_initialized = false
 

Macro Definition Documentation

#define CHECK_INIT
Value:
log_warn("Statistics not initialized"); \
return -1; \
}
static bool stats_initialized
#define log_warn(fmt,...)
Definition: logging.h:113

Definition at line 45 of file controller_stats.c.

#define N_STAT_TYPES   sizeof(stat_types) / sizeof(*stat_types)

Definition at line 42 of file controller_stats.c.

Function Documentation

struct timed_rrdb* get_msu_stat ( enum stat_id  id,
unsigned int  msu_id 
)

Definition at line 95 of file controller_stats.c.

static struct timed_rrdb* get_stat ( enum stat_id  id,
unsigned int  item_id 
)
static

Definition at line 61 of file controller_stats.c.

static struct stat_type* get_stat_type ( enum stat_id  id)
static

Definition at line 52 of file controller_stats.c.

struct timed_rrdb* get_thread_stat ( enum stat_id  id,
unsigned int  runtime_id,
unsigned int  thread_id 
)

Definition at line 85 of file controller_stats.c.

int init_statistics ( )

Initializes the entire stats module.

MUST BE CALLED before runtime starts

Definition at line 192 of file controller_stats.c.

int register_msu_stats ( unsigned int  msu_id,
int  msu_type_id,
int  thread_id,
int  runtime_id 
)

Definition at line 170 of file controller_stats.c.

int register_stat ( enum stat_id  stat_id,
unsigned int  item_id 
)

Definition at line 132 of file controller_stats.c.

int register_thread_stats ( unsigned int  thread_id,
unsigned int  runtime_id 
)

Definition at line 181 of file controller_stats.c.

void show_stats ( struct dfg_msu msu)

Definition at line 231 of file controller_stats.c.

int unregister_msu_stats ( unsigned int  msu_id)

Definition at line 116 of file controller_stats.c.

static int unregister_stat ( enum stat_id  stat_id,
unsigned int  item_id 
)
static

Definition at line 102 of file controller_stats.c.

int unregister_thread_stats ( unsigned int  thread_id,
unsigned int  runtime_id 
)

Definition at line 124 of file controller_stats.c.

Variable Documentation

struct stat_type stat_types[]
static
Initial value:
= {
}
#define REPORTED_STAT_TYPES
Definition: stats.h:96

Definition at line 38 of file controller_stats.c.

bool stats_initialized = false
static

Definition at line 43 of file controller_stats.c.