summaryrefslogtreecommitdiff
path: root/test/utils.hpp
diff options
context:
space:
mode:
authorchenzizhan <[email protected]>2024-07-10 11:02:36 +0800
committerchenzizhan <[email protected]>2024-07-10 11:02:36 +0800
commite1fd771fc7e33ffd659535e81412179e8ac6929a (patch)
tree33faa31e3282d84c9a07d181a93676bf5acac21f /test/utils.hpp
parentb711b50d356ffc09569d4f11ba2a0cae41045510 (diff)
spread sketch wipspreadsketch
Diffstat (limited to 'test/utils.hpp')
-rw-r--r--test/utils.hpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/utils.hpp b/test/utils.hpp
index 28dea2b..f758f1d 100644
--- a/test/utils.hpp
+++ b/test/utils.hpp
@@ -44,4 +44,25 @@ private:
double test_cal_topk_accuracy(std::vector<struct Fieldstat_tag_list_wrapper *> &test_result, std::unordered_map<std::string, int> &expected_count);
// after we change fieldstat_counter_get return a error code in, all the tests should change correspondingly, so just use a adapter aliasing the old function
-long long my_fieldstat_counter_get(const struct fieldstat *instance, int cube_id, int metric_id, int cell_id); \ No newline at end of file
+long long my_fieldstat_counter_get(const struct fieldstat *instance, int cube_id, int metric_id, int cell_id);
+
+
+struct Flow {
+ std::string src_ip;
+ std::string dst_ip;
+};
+
+class SpreadSketchZipfGenerator {
+private:
+ const int MAX_DATA = 1000000;
+ std::pair<std::string, std::string> *loadeds;
+ unsigned cursor;
+
+public:
+ SpreadSketchZipfGenerator(double alpha, int n);
+ struct Flow next();
+ ~SpreadSketchZipfGenerator();
+
+ double _alpha;
+ int _n;
+}; \ No newline at end of file