Export etl metrics to prometheus (#1256)

Fixes #1248.
This commit is contained in:
Sergey Kuznetsov
2024-03-14 11:37:31 +00:00
committed by GitHub
parent 010538d6fe
commit e83dfcbcc3
28 changed files with 708 additions and 51 deletions

View File

@@ -70,6 +70,13 @@ TEST_F(AnyCounterTests, operatorAdd)
counter += 42;
}
TEST_F(AnyCounterTests, set)
{
EXPECT_CALL(mockCounterImpl, value()).WillOnce(::testing::Return(4));
EXPECT_CALL(mockCounterImpl, set(42));
counter.set(42);
}
TEST_F(AnyCounterTests, reset)
{
EXPECT_CALL(mockCounterImpl, set(0));
@@ -82,6 +89,20 @@ TEST_F(AnyCounterTests, value)
EXPECT_EQ(counter.value(), 42);
}
struct AnyCounterDeathTest : AnyCounterTests {};
TEST_F(AnyCounterDeathTest, setLowerValue)
{
testing::Mock::AllowLeak(&mockCounterImpl);
EXPECT_DEATH(
{
EXPECT_CALL(mockCounterImpl, value()).WillOnce(::testing::Return(50));
counter.set(42);
},
".*"
);
}
struct CounterIntTests : ::testing::Test {
CounterInt counter{"test_counter", R"(label1="value1",label2="value2")"};
};