Skip to content

nancy prepare-workload

postgres-ai requested to merge nancy_prepare_workload into master

Created by: NikolayS

In this PR:

1) New command, nancy prepare-workload!

Heavily based on @myyorick's work, uses gawk with FPAT (see https://www.gnu.org/software/gawk/manual/html_node/Splitting-By-Content.html and many more tricks).

nancy prepare-workload tool prepares "real workload" file based on PostgreSQL CSV logs.

Example:

nancy prepare-workload --db-name my_database_name --output ./sample.replay ./sample.csv

-- it will take CSV-log ./sample.csv and produce replay-file ./sample.replay, which can be used in --workload-real of nancy run command.

2) CI tests

  • check that replay file can be created from a simple CSV log file
  • check that replay file (prepared in advance) can be used by nancy run --run-on localhost --workload-real ...

3) Some nancy run options were renamed

  • --workload-full-path-> --workload-real
  • --workload-replay-speed -> --workload-real-replay-speed
  • --workload-basis-path -> --workload-basis

Limitations:

  • Text logs are not yet supported.
  • Supported Postgres versions: 9.6+ (not yet tested with 9.5 and older)
  • the tool requires: gawk, pgreplay, bc
  • not yet tested on Mac OS, only on Linux

TODO

(postponed, will be done in separate PRs)

Merge request reports