1.初始化测试数据 (loading阶段)
bin/ycsb load redis -s -P workloads/workloada -p "redis.host=127.0.0.1" -p "redis.port=6379" workloada,定义recordcount=1000
2.执行测试操作(transaction阶段)
bin/ycsb run redis -s -P workloads/workloada -p "redis.host=127.0.0.1" -p "redis.port=6379" \
-threads 128 -p "operationcount=10000" -p "measurementtype=timeseries" \
-p "timeseries.granularity=5000"
-threads 模拟的线程数
-p 传入的参数,可以是客户端的参数,可以是YCSB内部组件的参数,比如 measurementtype:配置Measurements输出时间序列而不是直方图
-target 指的是每秒最大操作数,当一秒内到达这个阈值,线程就会休眠1毫秒
bin/ycsb load hbase10 -P workloads/workloada -p threads=10 -p table=usertable -p columnfamily=family -p recordcount=10000 -s > logs/load.log
bin/ycsb run hbase10 -P workloads/workloada -threads 10 -p operationcount=1000000 -p table=usertable -p columnfamily=family -p measurementtype=timeseries -p timeseries.granularity=2000 -s > logs/transaction-workloadAA.log
CREATE TABLE usertable ( YCSB_KEY string, FIELD0 string, FIELD1 string, FIELD2 string, FIELD3 string, FIELD4 string, FIELD5 string, FIELD6 string, FIELD7 string, FIELD8 string, FIELD9 string );
db.driver=org.apache.hive.jdbc.HiveDriver
db.url=jdbc:hive2://10.88.1.86:10000/ycsb
db.user=admin db.passwd=sany318!
bin/ycsb load jdbc -s -P workloads/workloada -P db.properties -cp /home/user/hive238/lib/hive-jdbc-2.3.3.jar > hive-load-workloada.log
bin/ycsb load jdbc -s -P workloads/workloada -P db.properties -cp mysql-connector-java.jar > mysql-load-workloada.log
bin/ycsb run jdbc -s -P workloads/workloada -P db.properties -cp mysql-connector-java.jar > mysql-run-workloada.log