summaryrefslogtreecommitdiff
path: root/test/test_performance.cpp
diff options
context:
space:
mode:
authorchenzizhan <[email protected]>2023-08-24 11:03:32 +0800
committerchenzizhan <[email protected]>2023-08-24 11:03:32 +0800
commitedbd04f3a0943192777b01920fcba8f850b18b0d (patch)
treef532318110a51860dc9f1ebf420835b0f9879836 /test/test_performance.cpp
parent4877381d3a41bf813f32578c88d5748c5bf7ff74 (diff)
performance: matric serialize
Diffstat (limited to 'test/test_performance.cpp')
-rw-r--r--test/test_performance.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/test_performance.cpp b/test/test_performance.cpp
index 9f654ff..e311b66 100644
--- a/test/test_performance.cpp
+++ b/test/test_performance.cpp
@@ -389,7 +389,7 @@
clock_t perform_serialize_test(std::function<void (struct fieldstat*, int, int, int)> metric_add_func,
std::function<int(struct fieldstat*, int)> metric_register_func, enum sampling_mode mode)
{
- const int MAX_CELL_NUM = 1000000;
+ const int MAX_CELL_NUM = 10000;
Fieldstat_tag_list_wrapper *tags[MAX_CELL_NUM];
for (int i = 0; i < MAX_CELL_NUM; i++) {
tags[i] = new Fieldstat_tag_list_wrapper("my key", i);
@@ -404,17 +404,21 @@ clock_t perform_serialize_test(std::function<void (struct fieldstat*, int, int,
char *blob;
size_t blob_size;
+ printf("start\n");
+
clock_t start = clock();
- printf("getchar\n");
- getchar();
+ // printf("getchar\n");
+ // getchar();
fieldstat_serialize(instance, &blob, &blob_size);
- exit(0);
+ // exit(0);
clock_t end = clock();
+ printf("end\n");
fieldstat_free(instance);
for (int i = 0; i < MAX_CELL_NUM; i++) {
delete tags[i];
}
+ free(blob);
return end - start;
}