summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangwei <[email protected]>2022-05-25 18:38:26 +0800
committeryangwei <[email protected]>2022-05-25 18:38:26 +0800
commitb2095aa2c9ade769c4772ec0fcc2f61e54e5f265 (patch)
tree9e169d4236d96f2384563af72e0bcb634b5c246c
parentda241e85e6310d2f924ab1bdb1c991354e6c62b9 (diff)
🧪 test(fs2_test): 调整测试sleep时间和循环测试次数,增加耗时打印输出v2.10.11
-rw-r--r--test/fs2_test.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/fs2_test.cpp b/test/fs2_test.cpp
index 23db6df..5b4af3f 100644
--- a/test/fs2_test.cpp
+++ b/test/fs2_test.cpp
@@ -102,9 +102,11 @@ int main(int argc, char *argv[])
char *url_path = (char *)"/prometheus";
FS_library_set_prometheus_url_path(url_path);
FS_library_init();
-
- for (int repeat_cnt = 0; repeat_cnt < 10; repeat_cnt++)
+ struct timespec start;
+ long time_use;
+ for (int repeat_cnt = 0; repeat_cnt < 2; repeat_cnt++)
{
+ record_time_start(&start);
handle = FS_create_handle();
@@ -201,9 +203,11 @@ int main(int argc, char *argv[])
FS_stop(&handle);
- printf("fs2 stoped cnt = %d, will sleep 1s\n", repeat_cnt);
+ time_use = record_time_elapse_us(&start);
+ printf("fs2 stoped cnt = %d, cost %ld us, will sleep 1s\n", repeat_cnt, time_use);
sleep(1);
}
+ printf("Start FS library destoryed ...\n");
FS_library_destroy();
printf("FS library destoryed, will sleep 30s\n");
sleep(30);