Testing class for Count Min Sketch. More...
#include <CMSketchTest.h>

Public Member Functions | |
| CMSketchTest (const std::string_view config_file) | |
| Constructor. More... | |
| void | runTest () override |
| Test Bloom Filter. More... | |
Public Member Functions inherited from OmniSketch::Test::TestBase< key_len, T > | |
| 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 | 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... | |
Additional Inherited Members | |
Protected Attributes inherited from OmniSketch::Test::TestBase< key_len, T > | |
| const std::string_view | show_name |
| const std::string_view | config_file |
| const std::string_view | test_path |
Testing class for Count Min Sketch.
|
inline |
Constructor.
Names from left to right are
|
overridevirtual |
Test Bloom Filter.
An overriden method
shorthand for convenience
Part I. Parse the config file
Step i. First we list the variables to parse, namely:
Step ii. Open the config file
Step iii. Set the working node of the parser.
Step iv. Parse num_bits and num_hash
Step v. Move to the data node
Step vi. Parse data and format
[Optional] User-defined rules
Step vii. Parse Cnt Method.
Part II. Prepare sketch and data
Step i. Initialize a sketch
remember that the left ptr must point to the base class in order to call the methods in it
Step ii. Get ground truth
1. read data
Step iii. Insert the samples and then look up all the flows
1. update records into the sketch
Reimplemented from OmniSketch::Test::TestBase< key_len, T >.