资源简介
sysbench 0.5版本的源码、安装包
代码片段和文件信息
/* Copyright (C) 2004 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License or
(at your option) any later version.
This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not write to the Free Software
Foundation Inc. 59 Temple Place Suite 330 Boston MA 02111-1307 USA
*/
#ifdef HAVE_CONFIG_H
# include “config.h“
#endif
#ifdef _WIN32
#include “sb_win.h“
#endif
#ifdef STDC_HEADERS
# include
#endif
#ifdef HAVE_STRING_H
# include
#endif
#ifdef HAVE_STRINGS_H
# include
#endif
#include “db_driver.h“
#include “sb_list.h“
/* Query length limit for bulk insert queries */
#define BULK_PACKET_SIZE (512*1024)
/* How many rows to insert before COMMITs (used in bulk insert) */
#define ROWS_BEFORE_COMMIT 1000
typedef struct {
unsigned long read_ops;
unsigned long write_ops;
unsigned long other_ops;
unsigned long transactions;
unsigned long deadlocks;
pthread_mutex_t stat_mutex;
} db_thread_stat_t;
/* Global variables */
db_globals_t db_globals;
/* Used in intermediate reports */
unsigned long last_transactions;
unsigned long last_read_ops;
unsigned long last_write_ops;
/* Static variables */
static sb_list_t drivers; /* list of available DB drivers */
static db_thread_stat_t *thread_stats; /* per-thread stats */
/* Timers used in debug mode */
static sb_timer_t *exec_timers;
static sb_timer_t *fetch_timers;
/* Static functions */
static int db_parse_arguments(void);
static void db_free_row(db_row_t *);
static int db_bulk_do_insert(db_conn_t * int);
static db_query_type_t db_get_query_type(const char *);
static void db_update_thread_stats(int db_query_type_t);
/* DB layer arguments */
static sb_arg_t db_args[] =
{
{
“db-driver“
“specifies database driver to use (‘help‘ to get list of available drivers)“
SB_ARG_TYPE_STRING NULL
}
{
“db-ps-mode“ “prepared statements usage mode {auto disable}“
SB_ARG_TYPE_STRING “auto“
}
{
“db-debug“ “print database-specific debug information“
SB_ARG_TYPE_FLAG “off“
}
{NULL NULL SB_ARG_TYPE_NULL NULL}
};
/* Register available database drivers and command line arguments */
int db_register(void)
{
sb_list_item_t *pos;
db_driver_t *drv;
/* Register database drivers */
SB_LIST_INIT(&drivers);
#ifdef USE_MYSQL
register_driver_mysql(&drivers);
#endif
#ifdef USE_DRIZZLE
register_driver_drizzle(&drivers);
#endif
#ifdef USE_DRIZZLECLIENT
register_driver_drizzleclient(&drivers);
#endif
#ifdef USE_ORACLE
register_dr
相关资源
- SecureCRT-6.0.2安装包和SecureCRT-6.0.2注册
- 易语言高仿迅雷5安装包源码
- redmine系统agile敏捷插件安装包
- Notepad++安装包
- redis安装包
- PowerBuilder安装包及教程大礼包
- Xcode 12.3(16F156)安装包.zip
- Tomcat7.0.52绿色版
- Visio安装包
- 局域结构畸变对Co2FeAl0.5Si0.5合金薄膜
- zeromq的windows版本安装包
- linux telnet服务安装包
- 气相色谱-质谱法 GB 23200.54-2016 食品安
- PSIM免破解安装包和使用教程
- CH341A编程器安装包
- Fotosizer v1.36.0.524
- IE-Tab_v10.9.8.1 for Chrome 离线安装包
- Er对铸态Mg-4Y-3Nd-0.5Zr合金组织和性能的
- Mn/Fe比对挤压铸造热处理态Al-5.0Cu-0.
- SNMP安装包(全+使用文档)
- TVideoGrabber.v.10.5.1.4.XE10.1.x32-x64.Cracke
- Catalyzed synthesis of 2-(4‘-ethylbenzoyl)
- 中维世纪jv9800采集卡驱动 v9.0.5.12 官方
- CST2018安装包+安装步骤.pdf
- 星宇财务记账软件V4.28安装包+注册机
- 公安生僻字安装包
- mongodb windows64位 4.0.10 msi安装包
- MCGS的软件安装包1.7216111
- git bash 2.19.1 Windows64安装包
- ns-2.34安装包
评论
共有 条评论