File broker_log_replay.c
FileList > broker > broker_log_replay.c
Go to the source code of this file
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include "cubrid_getopt.h"
#include "cas_common.h"
#include "cas_cci.h"
#include "broker_log_util.h"
#include "porting.h"
#include "error_code.h"
#include "filesys.hpp"
#include "filesys_temp.hpp"
Classes
Public Types
Public Static Attributes
Public Functions
Public Static Functions
| Type |
Name |
| void |
close_file (FILE * infp, FILE * outfp, FILE * cci_errfp, FILE * skip_sqlfp)
|
| int |
get_args (int argc, char * argv)
|
| int |
get_cci_type (char * p)
|
| char * |
get_next_log_line (FILE * infp, T_STRING * linebuf_tstr, const off_t last_offset, int * lineno)
|
| char * |
get_query_stmt_from_plan (int req)
|
| void |
get_sql_time_info (char * sql_log, T_SQL_INFO * info)
|
| READ_RESULT |
get_temp_file_line (char * read_buf, unsigned int read_buf_size, int * diff_time, char ** endp)
|
| int |
log_bind_value (int req, T_STRING * linebuf, char * sql_log, char * output_result, int remain_bind_buf)
|
| int |
log_execute (int con_h, int req, char * sql_log, double * execute_time)
|
| int |
log_prepare (FILE * cci_err, FILE * pass_sql, int con, char * sql_log, T_SQL_INFO * sql_info, T_SUMMARY_INFO * summary)
|
| int |
log_replay (char * infilename, char * outfilename)
|
| char * |
make_sql_info (char * info_buf, char * start_p, int diff_time, int buf_size)
|
| int |
open_file (char * infilename, char * outfilename, FILE ** infp, FILE ** outfp, FILE ** cci_errfp, FILE ** skip_sqlfp)
|
| void |
print_result (FILE * outfp, double max_diff_time, double min_diff_time, int tmp_line_len_max)
|
| int |
print_result_with_sort (FILE * outfp, int print_diff_time_lower, int num_query, int read_buf_max)
|
| int |
print_result_without_sort (FILE * outfp, int print_diff_time_lower, int read_buf_max)
|
| void |
print_summary_info (T_SUMMARY_INFO * summary)
|
| int |
print_temp_result (char * sql_log, T_SQL_INFO * info)
|
| int |
result_sort_func (const void * arg1, const void * arg2)
|
| void |
update_diff_time_statistics (double diff_time)
|
| void |
update_summary_info (T_SUMMARY_INFO * summary, T_SQL_INFO * sql_info)
|
Macros
Public Types Documentation
typedef READ_RESULT
typedef enum temp_read_result READ_RESULT;
typedef T_SQL_INFO
typedef struct t_sql_info T_SQL_INFO;
typedef T_SQL_RESULT
typedef struct t_sql_result T_SQL_RESULT;
typedef T_SUMMARY_INFO
typedef struct t_summary_info T_SUMMARY_INFO;
enum temp_read_result
enum temp_read_result {
READ_STOP = -1,
READ_CONTINUE = 0,
READ_SUCCESS = 1
};
Public Static Attributes Documentation
variable br_tmp_filename
char br_tmp_filename[PATH_MAX];
variable br_tmpfp
variable break_time
variable broker_port
variable check_date_flag
variable dbname
variable dbpasswd
variable dbuser
variable from_date
variable host
variable num_faster_queries
unsigned int num_faster_queries[(60000)];
variable num_slower_queries
unsigned int num_slower_queries[(60000)];
variable print_result_diff_time_lower
double print_result_diff_time_lower;
variable rewrite_query_flag
variable to_date
Public Functions Documentation
function main
int main (
int argc,
char * argv
)
Public Static Functions Documentation
function close_file
static void close_file (
FILE * infp,
FILE * outfp,
FILE * cci_errfp,
FILE * skip_sqlfp
)
function get_args
static int get_args (
int argc,
char * argv
)
function get_cci_type
static int get_cci_type (
char * p
)
function get_next_log_line
static char * get_next_log_line (
FILE * infp,
T_STRING * linebuf_tstr,
const off_t last_offset,
int * lineno
)
function get_query_stmt_from_plan
static char * get_query_stmt_from_plan (
int req
)
function get_sql_time_info
static void get_sql_time_info (
char * sql_log,
T_SQL_INFO * info
)
function get_temp_file_line
static READ_RESULT get_temp_file_line (
char * read_buf,
unsigned int read_buf_size,
int * diff_time,
char ** endp
)
function log_bind_value
static int log_bind_value (
int req,
T_STRING * linebuf,
char * sql_log,
char * output_result,
int remain_bind_buf
)
function log_execute
static int log_execute (
int con_h,
int req,
char * sql_log,
double * execute_time
)
function log_prepare
static int log_prepare (
FILE * cci_err,
FILE * pass_sql,
int con,
char * sql_log,
T_SQL_INFO * sql_info,
T_SUMMARY_INFO * summary
)
function log_replay
static int log_replay (
char * infilename,
char * outfilename
)
function make_sql_info
static char * make_sql_info (
char * info_buf,
char * start_p,
int diff_time,
int buf_size
)
function open_file
static int open_file (
char * infilename,
char * outfilename,
FILE ** infp,
FILE ** outfp,
FILE ** cci_errfp,
FILE ** skip_sqlfp
)
function print_result
static void print_result (
FILE * outfp,
double max_diff_time,
double min_diff_time,
int tmp_line_len_max
)
function print_result_with_sort
static int print_result_with_sort (
FILE * outfp,
int print_diff_time_lower,
int num_query,
int read_buf_max
)
function print_result_without_sort
static int print_result_without_sort (
FILE * outfp,
int print_diff_time_lower,
int read_buf_max
)
function print_summary_info
static void print_summary_info (
T_SUMMARY_INFO * summary
)
function print_temp_result
static int print_temp_result (
char * sql_log,
T_SQL_INFO * info
)
function result_sort_func
static int result_sort_func (
const void * arg1,
const void * arg2
)
function update_diff_time_statistics
static void update_diff_time_statistics (
double diff_time
)
function update_summary_info
static void update_summary_info (
T_SUMMARY_INFO * summary,
T_SQL_INFO * sql_info
)
Macro Definition Documentation
define BIND_STR_BUF_SIZE
#define BIND_STR_BUF_SIZE `(4096)`
define CCI_ERR_FILE_NAME
#define CCI_ERR_FILE_NAME `"replay.err"`
define DEFAULT_BREAK_TIME
#define DEFAULT_BREAK_TIME `(0.01) /* 10 millisecond */`
define DEFAULT_DIFF_TIME_LOWER
#define DEFAULT_DIFF_TIME_LOWER `(0.01) /* 10 millisecond */`
define INVALID_PORT_NUM
#define INVALID_PORT_NUM `(-1)`
define PASS_SQL_FILE_NAME
#define PASS_SQL_FILE_NAME `"skip.sql"`
define PROC_ERR
#define PROC_ERR (
code
) `/* multi line expression */`
define SORT_BUF_MAX
#define SORT_BUF_MAX `(4096)`
define SQL_INFO_TITLE_LEN
#define SQL_INFO_TITLE_LEN `(128)`
define STAT_MAX_DIFF_TIME
#define STAT_MAX_DIFF_TIME `(60000) /* 60 * 1000 : 10 min */`
define free_and_init
#define free_and_init (
ptr
) `/* multi line expression */`
The documentation for this class was generated from the following file cubrid/src/broker/broker_log_replay.c