@@ -35,7 +35,7 @@ TEST(BenchmarkOptions, Basic) {
3535 {" self-test" , " --project-id=test-project" , " --instance-id=test-instance" ,
3636 " --app-profile-id=test-app-profile-id" , " --table-size=10000" ,
3737 " --test-duration=300s" , " --use-embedded-server=true" ,
38- " --include-read-rows=true" },
38+ " --include-read-rows=true" , " --metrics-period=10s " },
3939 " " );
4040 ASSERT_STATUS_OK (options);
4141 EXPECT_FALSE (options->exit_after_parse );
@@ -46,6 +46,8 @@ TEST(BenchmarkOptions, Basic) {
4646 EXPECT_EQ (300 , options->test_duration .count ());
4747 EXPECT_EQ (true , options->use_embedded_server );
4848 EXPECT_EQ (true , options->include_read_rows );
49+ EXPECT_THAT (options->metrics_period ,
50+ ::testing::Optional (std::chrono::seconds(10 )));
4951}
5052
5153TEST (BenchmarkOptions, Defaults) {
@@ -64,6 +66,7 @@ TEST(BenchmarkOptions, Defaults) {
6466 options->test_duration .count ());
6567 EXPECT_EQ (false , options->use_embedded_server );
6668 EXPECT_EQ (10 , options->parallel_requests );
69+ EXPECT_FALSE (options->metrics_period .has_value ());
6770}
6871
6972TEST (BenchmarkOptions, Initialization) {
@@ -105,6 +108,13 @@ TEST(BenchmarkOptions, Validate) {
105108 EXPECT_FALSE (ParseBenchmarkOptions (
106109 {" self-test" , " --project-id=a" , " --instance-id=b" , " --test-duration=0" },
107110 " " ));
111+ EXPECT_FALSE (ParseBenchmarkOptions (
112+ {" self-test" , " --project-id=a" , " --instance-id=b" , " --metrics-period=0s" },
113+ " " ));
114+ EXPECT_FALSE (
115+ ParseBenchmarkOptions ({" self-test" , " --project-id=a" , " --instance-id=b" ,
116+ " --metrics-period=-5s" },
117+ " " ));
108118}
109119
110120} // namespace
0 commit comments