Collection of metrics. More...
#include <test.h>

Public Member Functions | |
| TestBase (const std::string_view show_name, const std::string_view config_file, const std::string_view test_path) | |
| Construct by specifying all necessary tables in config file. More... | |
| virtual void | show () const final |
| Display metrics in a human-readable manner. More... | |
| virtual void | runTest () |
| Run the test and collect statistics. More... | |
| virtual void | testSize (std::unique_ptr< Sketch::SketchBase< key_len, T >> &ptr_sketch) final |
| Get the size of the sketch. More... | |
| virtual void | testInsert (std::unique_ptr< Sketch::SketchBase< key_len, T >> &ptr_sketch, typename std::vector< Data::Record< key_len >>::const_iterator begin, typename std::vector< Data::Record< key_len >>::const_iterator end) final |
| Insert a row of records. More... | |
| virtual void | testUpdate (std::unique_ptr< Sketch::SketchBase< key_len, T >> &ptr_sketch, typename std::vector< Data::Record< key_len >>::const_iterator begin, typename std::vector< Data::Record< key_len >>::const_iterator end, Data::CntMethod cnt_method) final |
| Update a row of records (with values to the sketch) More... | |
| virtual void | testQuery (std::unique_ptr< Sketch::SketchBase< key_len, T >> &ptr_sketch, const Data::GndTruth< key_len, T > &gnd_truth) final |
| Query for each flow in ground truth. More... | |
| virtual void | testLookup (std::unique_ptr< Sketch::SketchBase< key_len, T >> &ptr_sketch, const Data::GndTruth< key_len, T > &gnd_truth, const Data::GndTruth< key_len, T > &sample) final |
| Lookup each flow in ground truth. More... | |
| virtual void | testHeavyHitter (std::unique_ptr< Sketch::SketchBase< key_len, T >> &ptr_sketch, double threshold, Data::GndTruth< key_len, T > gnd_truth_heavy_hitters) final |
| Test heavy hitters. More... | |
| virtual void | testHeavyChanger (std::unique_ptr< Sketch::SketchBase< key_len, T >> &ptr_sketch_1, std::unique_ptr< Sketch::SketchBase< key_len, T >> &ptr_sketch_2, double threshold, Data::GndTruth< key_len, T > gnd_truth_heavy_changers) final |
| Test heavy changers. More... | |
| virtual void | testDecode (std::unique_ptr< Sketch::SketchBase< key_len, T >> &ptr_sketch, Data::GndTruth< key_len, T > gnd_truth) final |
| Test decode. More... | |
Protected Attributes | |
| const std::string_view | show_name |
| const std::string_view | config_file |
| const std::string_view | test_path |
Collection of metrics.
| key_len | length of flowkey |
| T | type of the counter |
| Test Routine | Required Overriden Function | Available Metrics (In Test::Metric) | Name of the Testing Routine in TOML |
| testSize() | size() | SIZE | None (Once calling testSize(), the metric is collected) |
| testInsert() | insert() | RATE | insert |
| testUpdate() | update() | RATE | update |
| testQuery() | query() | RATE, ARE, AAE, ACC, PODF, DIST | query |
| testLookup() | lookup() | RATE, TP, FP, PRC | lookup |
| testHeavyHitter() | getHeavyHitter() | TIME, ARE, PRC, RCL, F1 | heavyhitter |
| testHeavyChanger() | getHeavyChanger() | TIME, ARE, PRC, RCL, F1 | heavychanger |
| testDecode() | decode() | TIME, RATIO, ARE, AAE, ACC, PODF, DIST | decode |
|
inline |
Construct by specifying all necessary tables in config file.
| show_name | The name to be shown in the output (may contain whitespaces) |
| config_file | Path to the config file |
| test_path | Path to the node which stores the testing metrics (concatenated with '.', see example below) |
If the toml file is as follows,
and you want the readable name "My Tiny Little Sketch" when showing results, then you should call constructor in this way:
show_name, all other strings should contain no whitespaces.
|
virtual |
Run the test and collect statistics.
Make sure this method is overriden in subclass.
Reimplemented in OmniSketch::Test::CHCMSketchTest< key_len, no_layer, T, hash_t >, OmniSketch::Test::CUSketchTest< key_len, T, hash_t >, OmniSketch::Test::HashPipeTest< key_len, T, hash_t >, OmniSketch::Test::CMSketchTest< key_len, T, hash_t >, OmniSketch::Test::CountSketchTest< key_len, T, hash_t >, OmniSketch::Test::FlowRadarTest< key_len, T, hash_t >, OmniSketch::Test::BloomFilterTest< key_len, hash_t >, and OmniSketch::Test::CountingBloomFilterTest< key_len, hash_t >.
|
finalvirtual |
|
finalvirtual |
Test decode.
You should override the Sketch::SketchBase::decode() method.
| ptr_sketch | pointer to the sketch |
| gnd_truth | ground truth |
|
finalvirtual |
Test heavy changers.
You should override the Sketch::SketchBase::getHeavyChangers() method.
| ptr_sketch_1 | pointer to the first sketch |
| ptr_sketch_2 | pointer to the second sketch |
| threshold | threshold value of heavy changers |
| gnd_truth_heavy_changers | ground truth of heavy changers (relative to the first sketch) |
|
finalvirtual |
Test heavy hitters.
You should override the Sketch::SketchBase::getHeavyHitter() method.
| ptr_sketch | pointer to the sketch |
| threshold | threshold value of heavy hitters |
| gnd_truth_heavy_hitters | ground truth of heavy hitters |
|
finalvirtual |
Insert a row of records.
Records in [begin, end) will be sequentially inserted. You should override the Sketch::SketchBase::insert() method.
| ptr_sketch | pointer to the sketch |
| begin | [begin, end) |
| end | [begin, end) |
|
finalvirtual |
Lookup each flow in ground truth.
You should override the Sketch::SketchBase::lookup() method.
| ptr_sketch | pointer to the sketch |
| gnd_truth | ground truth |
| sample | sampled ground truth |
|
finalvirtual |
Query for each flow in ground truth.
You should override the Sketch::SketchBase::query() method.
| ptr_sketch | pointer to the sketch |
| gnd_truth | ground truth |
|
finalvirtual |
Get the size of the sketch.
You should override the Sketch::SketchBase::size() method.
| ptr_sketch | pointer to the sketch |
|
finalvirtual |
Update a row of records (with values to the sketch)
Records in [begin, end) will be sequentially updated. You should override the Sketch::SketchBase::update() method.
|
protected |
|
protected |
|
protected |