CUBRID Engine  latest
cas_query_info.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include "cas_common.h"
#include "cas_query_info.h"
#include "broker_log_sql_list.h"
#include "broker_log_top.h"
Include dependency graph for cas_query_info.c:

Go to the source code of this file.

Macros

#define LOG_TOP_RES_FILE   "log_top.res"
 
#define LOG_TOP_Q_FILE   "log_top.q"
 
#define LOG_TOP_TAG_FILE   "tags"
 
#define LOG_TOP_NE_FILE   "log_top.ne"
 

Functions

static int sort_func (const void *arg1, const void *arg2)
 
static char * time2str (int t, char *buf)
 
void query_info_init (T_QUERY_INFO *qi)
 
void query_info_clear (T_QUERY_INFO *qi)
 
void query_info_print (void)
 
int query_info_add (T_QUERY_INFO *qi, int exec_time, int execute_res, char *filename, int lineno, char *end_date)
 
int query_info_add_ne (T_QUERY_INFO *qi, char *end_date)
 

Variables

static T_QUERY_INFOquery_info_arr = NULL
 
static int num_query_info = 0
 

Macro Definition Documentation

#define LOG_TOP_NE_FILE   "log_top.ne"

Definition at line 42 of file cas_query_info.c.

Referenced by query_info_print().

#define LOG_TOP_Q_FILE   "log_top.q"

Definition at line 40 of file cas_query_info.c.

Referenced by query_info_print().

#define LOG_TOP_RES_FILE   "log_top.res"

Definition at line 39 of file cas_query_info.c.

Referenced by query_info_print().

#define LOG_TOP_TAG_FILE   "tags"

Definition at line 41 of file cas_query_info.c.

Referenced by query_info_print().

Function Documentation

int query_info_add ( T_QUERY_INFO qi,
int  exec_time,
int  execute_res,
char *  filename,
int  lineno,
char *  end_date 
)
int query_info_add_ne ( T_QUERY_INFO qi,
char *  end_date 
)

Definition at line 273 of file cas_query_info.c.

References t_query_info::cas_log, check_log_time(), FREE_MEM, i, NULL, num_query_info, t_query_info::organized_sql, query_info_init(), REALLOC, t_query_info::sql, t_query_info::start_date, and strdup().

Referenced by log_top().

Here is the caller graph for this function:

void query_info_clear ( T_QUERY_INFO qi)

Definition at line 76 of file cas_query_info.c.

References t_query_info::cas_log, FREE_MEM, t_query_info::organized_sql, t_query_info::sql, and t_query_info::start_date.

Referenced by log_top().

Here is the caller graph for this function:

void query_info_init ( T_QUERY_INFO qi)

Definition at line 68 of file cas_query_info.c.

References t_query_info::max, and t_query_info::min.

Referenced by log_top(), query_info_add(), and query_info_add_ne().

Here is the caller graph for this function:

void query_info_print ( void  )

Definition at line 85 of file cas_query_info.c.

References cubregex::count(), i, log_top_mode, LOG_TOP_NE_FILE, LOG_TOP_Q_FILE, LOG_TOP_RES_FILE, LOG_TOP_TAG_FILE, max, min, MODE_PROC_TIME, NULL, num_query_info, sort_func(), sql_info_write(), TEST, and time2str().

Referenced by log_top_query().

Here is the caller graph for this function:

static int sort_func ( const void *  arg1,
const void *  arg2 
)
static

Definition at line 346 of file cas_query_info.c.

References max.

Referenced by query_info_print().

Here is the caller graph for this function:

static char * time2str ( int  t,
char *  buf 
)
static

Definition at line 352 of file cas_query_info.c.

Referenced by query_info_print().

Here is the caller graph for this function:

Variable Documentation

int num_query_info = 0
static

Definition at line 48 of file cas_query_info.c.

Referenced by query_info_add(), query_info_add_ne(), and query_info_print().

T_QUERY_INFO* query_info_arr = NULL
static

Definition at line 47 of file cas_query_info.c.