mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
- Implement a wrapper script for launching a docker-galaxy-stable setup a many ways for this task including:
- Configure container's Galaxy with outer Galaxy's lib and test directory.
- Collect log files.
- Log a statement for interacting with the container easily while the test is running.
- Disable unneeded services.
- Implement a fan-in-fan-out style workflow for performance testing.
- Add an option to test performance of scheduling workflows without actually running jobs.
- Sample tool for creating large collections easily at beginning of tests (much faster than uploads).
- Sample tool for splitting a file into a collection for fan in and out workflow test.
- Assume Python 2.7 in scripts to simplify things.
- Add documentation.
51 lines
1.3 KiB
Python
51 lines
1.3 KiB
Python
"""Script to parse timings out of a Galaxy log and summarize."""
|
|
from __future__ import print_function
|
|
|
|
from argparse import ArgumentParser
|
|
import re
|
|
|
|
import numpy
|
|
|
|
|
|
DESCRIPTION = ""
|
|
|
|
TIMING_LINE_PATTERN = re.compile("\((\d+.\d+) ms\)")
|
|
|
|
|
|
def main(argv=None):
|
|
"""Entry point for script."""
|
|
arg_parser = ArgumentParser(description=DESCRIPTION)
|
|
arg_parser.add_argument("--file", default="paster.log")
|
|
arg_parser.add_argument("--print_lines", default=False, action="store_true")
|
|
arg_parser.add_argument("--pattern", default=None)
|
|
|
|
args = arg_parser.parse_args(argv)
|
|
print_lines = args.print_lines
|
|
pattern_str = args.pattern
|
|
filter_pattern = re.compile(pattern_str) if pattern_str is not None else None
|
|
times = []
|
|
for line in open(args.file, "r"):
|
|
if filter_pattern and not filter_pattern.search(line):
|
|
continue
|
|
|
|
match = TIMING_LINE_PATTERN.search(line)
|
|
if not match:
|
|
continue
|
|
|
|
times.append(float(match.group(1)))
|
|
if print_lines:
|
|
print(line.strip())
|
|
|
|
template = "Summary (ms) - Mean: %f, Median: %f, Max: %f, Min: %f, StdDev: %f"
|
|
message = template % (
|
|
numpy.mean(times),
|
|
numpy.median(times),
|
|
numpy.max(times),
|
|
numpy.min(times),
|
|
numpy.std(times)
|
|
)
|
|
print(message)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|