1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

For #2899: Exporter: Add metrics cpu, memory and uname. (#3224)

* Exporter: metrics support cpu gauge.
* Exporter: metrics support memory and uname..
* Exporter: Ignore error when uname fail.

Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
chundonglinlin 2022-10-31 08:53:58 +08:00 committed by GitHub
parent 9673bfb92c
commit 9f4338bd9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 78 additions and 3 deletions

View file

@ -3644,6 +3644,15 @@ VOID TEST(ConfigMainTest, CheckVhostConfig5)
EXPECT_EQ(0, (int)conf.get_stats_network());
EXPECT_TRUE(conf.get_stats_disk_device() != NULL);
}
if (true) {
MockSrsConfig conf;
HELPER_ASSERT_SUCCESS(conf.parse(_MIN_OK_CONF "exporter{enabled on;listen 9972;label cn-beijing;tag cn-edge;}"));
EXPECT_TRUE(conf.get_exporter_enabled());
EXPECT_STREQ("9972", conf.get_exporter_listen().c_str());
EXPECT_STREQ("cn-beijing", conf.get_exporter_label().c_str());
EXPECT_STREQ("cn-edge", conf.get_exporter_tag().c_str());
}
}
VOID TEST(ConfigMainTest, CheckIncludeConfig)