microsoft / StorScore

A test framework to evaluate SSDs and HDDs
http://aka.ms/storscore
MIT License
81 stars 34 forks source link

Make cmd_line writable from Recipe #36

Open lauracaulfield opened 7 years ago

lauracaulfield commented 7 years ago

I would like to define some command line options from within a recipe. For example:

$cmd_line->keep_logman_raw = 1;

test( description => "4k Random Reads", write_percentage => 0, access_pattern => 'random', block_size => '4K', queue_depth => 1, warmup_time => 60, run_time => 3600, );

Currently, the first line fails.

marksantaniello commented 7 years ago

I recall discussing something like this before.

Many command line options are read once early at startup, and are expected not to change afterward. Imagine, for example, if halfway through the recipe you could change to a different target. That could be very bad. But maybe this is a case where it would not be a problem.

One strategy for stuff like this is to have two knobs: one on the command line which allows you to set the default, but then to allow some per-step argument that overrides the default.

Maybe you could add a boolean "cleanup" argument to LogmanRunner::stop(), which defaults to true. Then in Recipe.pm you could pass "$step->{keep_logman_raw} // $cmd_line->keep_logman_raw". Then you could define a test like this:

test( description => "4k Random Reads", write_percentage => 0, access_pattern => 'random', block_size => '4K', queue_depth => 1, warmup_time => 60, run_time => 3600, keep_logman_raw => 1 );

lauracaulfield commented 7 years ago

Thanks for the discussion. It helped connect some dots.

To make the general pattern explicit (for others and my future self): StorScore needs to handle mid-recipe changes to the command line parameters explicitly. Our way of implementing that is to add arguments to the "test" sub.

keep_logman_raw has some interesting implications. You could have a recipe that keeps all the raw counters around for a subset of tests that you want to "zoom in" on, without keeping around a ton of data for the other tests.