MYDDAS: New internal organization and new MYDDAS statistics

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1645 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
tiagosoares
2006-05-22 16:31:47 +00:00
parent 40178a0285
commit f77458e11f
13 changed files with 546 additions and 229 deletions

View File

@@ -1,7 +1,10 @@
#ifndef __MYDDAS_STRUCTS_H__
#define __MYDDAS_STRUCTS_H__
#include "myddas_util.h"
#include "myddas.h"
#ifdef MYDDAS_STATS
#include "myddas_statistics_structs.h"
#endif
struct myddas_global {
MYDDAS_UTIL_CONNECTION myddas_top_connections;
@@ -13,17 +16,6 @@ struct myddas_global {
#endif
};
#ifdef MYDDAS_STATS
/* This strucuture holds some global statistics*/
struct myddas_global_stats {
/* Total Time spent on the db_row function */
MYDDAS_STATS_TIME total_db_row;
/* Total Time spent on the translate/3 predicate*/
MYDDAS_STATS_TIME total_translate;
};
#endif /* MYDDAS_STATS */
struct myddas_list_preds {
char *pred_module;
char *pred_name;
@@ -40,33 +32,37 @@ struct myddas_list_connection {
MySQL connection, if not then it as the pointer
to the ODBC enviromment variable */
void *odbc_enviromment;
#ifdef MYDDAS_STATS
/* Total number of Rows returnes from the DataBase Server */
unsigned long totalNumberOfRows;
/* Total Time spent by the DataBase Server
processing all querys */
MYDDAS_STATS_TIME totalTimeofDBServer;
/* Time spent by the DataBase Server, processing
the last query */
MYDDAS_STATS_TIME lastTimeofDBServer;
/* Total Time spent by the DataBase Server,
transfering all the data to the client */
MYDDAS_STATS_TIME totalFromDBServer;
/* Time spent by the DataBase Server,
transfering the data of the last query */
MYDDAS_STATS_TIME lastFromDBServer;
/* Last bytes transfered from the server */
unsigned long totalBytesTransfered;
/* Total bytes transfered from the server */
unsigned long lastBytesTransfered;
/* Number of querys made to the Server*/
unsigned long total_querys_made;
MYDDAS_STATS_STRUCT stats;
#endif
/* #ifdef MYDDAS_STATS */
/* /\* Total number of Rows returnes from the DataBase Server *\/ */
/* unsigned long totalNumberOfRows; */
/* /\* Total Time spent by the DataBase Server */
/* processing all querys *\/ */
/* MYDDAS_STATS_TIME totalTimeofDBServer; */
/* /\* Time spent by the DataBase Server, processing */
/* the last query *\/ */
/* MYDDAS_STATS_TIME lastTimeofDBServer; */
/* /\* Total Time spent by the DataBase Server, */
/* transfering all the data to the client *\/ */
/* MYDDAS_STATS_TIME totalFromDBServer; */
/* /\* Time spent by the DataBase Server, */
/* transfering the data of the last query *\/ */
/* MYDDAS_STATS_TIME lastFromDBServer; */
/* /\* Last bytes transfered from the server *\/ */
/* unsigned long totalBytesTransfered; */
/* /\* Total bytes transfered from the server *\/ */
/* unsigned long lastBytesTransfered; */
/* /\* Number of querys made to the Server*\/ */
/* unsigned long total_querys_made; */
/* #endif */
MYDDAS_UTIL_PREDICATE predicates;
/* Multi Queries Section */
@@ -84,26 +80,4 @@ struct myddas_util_query{
MYDDAS_UTIL_QUERY next;
};
#if defined MYDDAS_STATS || defined MYDDAS_TOP_LEVEL
struct myddas_stats_time_struct{
enum {time_copy,
time_final} type;
union {
struct {
unsigned long tv_sec;
unsigned long tv_usec;
} time_copy;
struct {
unsigned short hours;
unsigned short minutes; //Max 59
unsigned short seconds; //Max 59
unsigned short miliseconds; //Max 999
unsigned short microseconds; //Max 999
} time_final;
} u;
};
#endif /* MYDDAS_STATS || MYDDAS_TOP_LEVEL */
#endif