Skip to content

Commit

Permalink
Merge pull request AlexanderChudnovets#8 from chjwang/master
Browse files Browse the repository at this point in the history
add list_tables, fix benchmark_runner
  • Loading branch information
AlexanderChudnovets committed Oct 21, 2014
2 parents abd8e8f + fa75817 commit 1e84b63
Show file tree
Hide file tree
Showing 8 changed files with 914 additions and 1 deletion.
2 changes: 1 addition & 1 deletion benchmark_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def run_benchmark(config_file, config, testcase):
config = template
for key in case:
config = config.replace('{{%s}}' % key, case[key])
with open(os.path.join(sys.argv[2], 'config.py', 'w') as f:
with open(os.path.join(sys.argv[2], 'config.py'), 'w') as f:
f.write(config)
try:
run_benchmark(sys.argv[1], conf, sys.argv[2])
Expand Down
2 changes: 2 additions & 0 deletions tests/list_tables/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from setup import setup
from teardown import cleanup
20 changes: 20 additions & 0 deletions tests/list_tables/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
SLAVE_COUNT = 2
LOCUST_COUNT = 10
HATCH_RATE = 10
MIN_WAIT = 0
MAX_WAIT = 0
TABLES_CREATED_3_FIELDS_NO_LSI = 10
TABLES_CREATED_3_FIELDS_1_LSI = 10
TABLES_CREATED_10_FIELDS_5_LSI = 10
TABLE_NAME = "item_metadata"
LIMIT = 10
TOKEN_PROJECT = "/tmp/token_project.txt"
TABLE_LIST='/tmp/table_list.txt'
ITEM_KEY_LIST = '/tmp/item_key_list.txt'
CASSANDRA_NODES='127.0.0.1'
CASSANDRA_CLEANER='/root/scripts/cleaner.sh'

token_req_headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
20 changes: 20 additions & 0 deletions tests/list_tables/ks_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import json
import os.path

import config as cfg


TOKEN = None
PROJECT_ID = None

if os.path.isfile(cfg.TOKEN_PROJECT):
with open(cfg.TOKEN_PROJECT) as token_proj_file:
token_project = json.load(token_proj_file)
TOKEN = token_project['token'].strip()
PROJECT_ID = token_project['project_id'].strip()

req_headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Auth-Token': TOKEN
}
Loading

0 comments on commit 1e84b63

Please sign in to comment.