Skip to content

Commit

Permalink
Add test for removing metrics from family
Browse files Browse the repository at this point in the history
  • Loading branch information
jupp0r committed Sep 28, 2016
1 parent f47d946 commit b3cf25c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/family_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ TEST_F(FamilyTest, counter_value) {
ASSERT_GE(collected[0].metric_size(), 1);
EXPECT_THAT(collected[0].metric(0).counter().value(), Eq(1));
}

TEST_F(FamilyTest, remove) {
auto family = Family<Counter>{"total_requests", "Counts all requests", {}};
auto counter1 = family.add({{"name", "counter1"}});
family.add({{"name", "counter2"}});
family.remove(counter1);
auto collected = family.collect();
ASSERT_GE(collected.size(), 1);
EXPECT_EQ(collected[0].metric_size(), 1);
}

0 comments on commit b3cf25c

Please sign in to comment.