summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2021-10-08 13:12:36 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-08 02:34:40 +0000
commitbb08e0cb882972e62e0b3739c99f685172ff2c93 (patch)
treeb352d9d87aee693775b1a79c1d2b112147186441
parentf313cc48426080bc9519d3301845acc2badd36fc (diff)
downloadmongo-bb08e0cb882972e62e0b3739c99f685172ff2c93.tar.gz
Import wiredtiger: e596f7d42f9c91148af2b21243ab5d3a654e7a87 from branch mongodb-master
ref: 794298374c..e596f7d42f for: 5.1.1 WT-8199 Make s_all accept Python PEP8 compliant line breaks
-rw-r--r--src/third_party/wiredtiger/bench/wtperf/wtperf_run_py/perf_stat_collection.py2
-rw-r--r--src/third_party/wiredtiger/bench/wtperf/wtperf_run_py/wtperf_run.py21
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_whitespace1
-rw-r--r--src/third_party/wiredtiger/import.data2
4 files changed, 17 insertions, 9 deletions
diff --git a/src/third_party/wiredtiger/bench/wtperf/wtperf_run_py/perf_stat_collection.py b/src/third_party/wiredtiger/bench/wtperf/wtperf_run_py/perf_stat_collection.py
index d2784901311..b26c66a020b 100644
--- a/src/third_party/wiredtiger/bench/wtperf/wtperf_run_py/perf_stat_collection.py
+++ b/src/third_party/wiredtiger/bench/wtperf/wtperf_run_py/perf_stat_collection.py
@@ -1,6 +1,7 @@
import re
from perf_stat import PerfStat
+
def find_stat(test_stat_path: str, pattern: str, position_of_value: int):
for line in open(test_stat_path):
match = re.match(pattern, line)
@@ -8,6 +9,7 @@ def find_stat(test_stat_path: str, pattern: str, position_of_value: int):
return float(line.split()[position_of_value])
return 0
+
class PerfStatCollection:
def __init__(self):
self.perf_stats = {}
diff --git a/src/third_party/wiredtiger/bench/wtperf/wtperf_run_py/wtperf_run.py b/src/third_party/wiredtiger/bench/wtperf/wtperf_run_py/wtperf_run.py
index fcd9e8d0cb8..fb1b1f18d6c 100644
--- a/src/third_party/wiredtiger/bench/wtperf/wtperf_run_py/wtperf_run.py
+++ b/src/third_party/wiredtiger/bench/wtperf/wtperf_run_py/wtperf_run.py
@@ -11,18 +11,19 @@ from wtperf_config import WTPerfConfig
from perf_stat import PerfStat
from perf_stat_collection import PerfStatCollection
-# example parameters: -p /Users/jeremy.thorp/Git/wiredtiger/build/bench/wtperf/wtperf -t ../runners/small-lsm.wtperf -v -ho WT_TEST -m 3
-
# the 'test.stat' file is where wt-perf.c writes out it's statistics
# (within the directory specified by the 'home' parameter)
test_stats_file = 'test.stat'
+
def create_test_home_path(home: str, test_run: int):
return '{}_{}'.format(home, test_run)
+
def create_test_stat_path(test_home_path: str):
return os.path.join(test_home_path, test_stats_file)
+
def find_stat(test_stat_path: str, pattern: str, position_of_value: int):
for line in open(test_stat_path):
match = re.match(pattern, line)
@@ -30,6 +31,7 @@ def find_stat(test_stat_path: str, pattern: str, position_of_value: int):
return line.split()[position_of_value]
return 0
+
def construct_wtperf_command_line(wtperf: str, env: str, test: str, home: str):
command_line = []
if env is not None:
@@ -43,6 +45,7 @@ def construct_wtperf_command_line(wtperf: str, env: str, test: str, home: str):
command_line.append(home)
return command_line
+
def run_test(config: WTPerfConfig, test_run: int):
test_home = create_test_home_path(home=config.home_dir, test_run=test_run)
command_line = construct_wtperf_command_line(
@@ -53,6 +56,7 @@ def run_test(config: WTPerfConfig, test_run: int):
# print('Command Line for test: {}'.format(command_line))
subprocess.run(command_line)
+
def process_results(config: WTPerfConfig, perf_stats: PerfStatCollection):
for test_run in range(config.run_max):
test_home = create_test_home_path(home=config.home_dir, test_run=test_run)
@@ -72,6 +76,7 @@ def process_results(config: WTPerfConfig, perf_stats: PerfStatCollection):
}
return as_dict
+
def setup_perf_stats():
perf_stats = PerfStatCollection()
perf_stats.add_stat(PerfStat(short_label="load",
@@ -81,27 +86,28 @@ def setup_perf_stats():
output_precision=2,
conversion_function=float))
perf_stats.add_stat(PerfStat(short_label="insert",
- pattern='Executed \d+ insert operations',
+ pattern=r'Executed \d+ insert operations',
input_offset=1,
output_label='Insert count:'))
perf_stats.add_stat(PerfStat(short_label="modify",
- pattern='Executed \d+ modify operations',
+ pattern=r'Executed \d+ modify operations',
input_offset=1,
output_label='Modify count:'))
perf_stats.add_stat(PerfStat(short_label="read",
- pattern='Executed \d+ read operations',
+ pattern=r'Executed \d+ read operations',
input_offset=1,
output_label='Read count:'))
perf_stats.add_stat(PerfStat(short_label="truncate",
- pattern='Executed \d+ truncate operations',
+ pattern=r'Executed \d+ truncate operations',
input_offset=1,
output_label='Truncate count:'))
perf_stats.add_stat(PerfStat(short_label="update",
- pattern='Executed \d+ update operations',
+ pattern=r'Executed \d+ update operations',
input_offset=1,
output_label='Update count:'))
return perf_stats
+
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--wtperf', help='path of the wtperf executable')
@@ -163,5 +169,6 @@ def main():
with open(args.outfile, 'w') as outfile:
json.dump(perf_dict, outfile, indent=4, sort_keys=True)
+
if __name__ == '__main__':
main()
diff --git a/src/third_party/wiredtiger/dist/s_whitespace b/src/third_party/wiredtiger/dist/s_whitespace
index 67f7da480f4..1e4b36563a0 100755
--- a/src/third_party/wiredtiger/dist/s_whitespace
+++ b/src/third_party/wiredtiger/dist/s_whitespace
@@ -21,7 +21,6 @@ find bench dist examples ext src test \
-name '*.[ch]' -o \
-name '*.dox' -o \
-name '*.in' -o \
- -name '*.py' -o \
-name 's_*' -o \
-name 'Makefile.am' |
sed -e '/Makefile.in/d' \
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 7c7c304d2de..a3b05269a9f 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-master",
- "commit": "794298374cc334ed611934143809cedd735b7f9b"
+ "commit": "e596f7d42f9c91148af2b21243ab5d3a654e7a87"
}