MCPcopy Create free account
hub / github.com/apache/mesos / Metrics

Function Metrics

src/tests/utils.cpp:55–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53#endif
54
55JSON::Object Metrics()
56{
57 UPID upid("metrics", process::address());
58
59 // TODO(neilc): This request might timeout if the current value of a
60 // metric cannot be determined. In tests, a common cause for this is
61 // MESOS-6231 when multiple scheduler drivers are in use.
62 Future<http::Response> response = http::get(upid, "snapshot");
63
64 AWAIT_EXPECT_RESPONSE_STATUS_EQ(http::OK().status, response);
65 AWAIT_EXPECT_RESPONSE_HEADER_EQ(APPLICATION_JSON, "Content-Type", response);
66
67 Try<JSON::Object> parse = JSON::parse<JSON::Object>(response->body);
68 CHECK_SOME(parse);
69
70 return parse.get();
71}
72
73
74Try<uint16_t> getFreePort()

Callers 15

TEST_FFunction · 0.70
TEST_PFunction · 0.70
TEST_PFunction · 0.70
TEST_FFunction · 0.70
TEST_FFunction · 0.70
verifyCacheMetricsMethod · 0.70
TEST_PFunction · 0.70
TEST_FFunction · 0.70
TEST_PFunction · 0.70
TYPED_TESTFunction · 0.70
TEST_FFunction · 0.70

Calls 4

OKClass · 0.85
addressFunction · 0.50
getFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected