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

Function memsw_limit_in_bytes

src/linux/cgroups.cpp:2352–2374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2350
2351
2352Result<Bytes> memsw_limit_in_bytes(
2353 const string& hierarchy,
2354 const string& cgroup)
2355{
2356 if (!cgroups::exists(hierarchy, cgroup, "memory.memsw.limit_in_bytes")) {
2357 return None();
2358 }
2359
2360 Try<string> read = cgroups::read(
2361 hierarchy, cgroup, "memory.memsw.limit_in_bytes");
2362
2363 if (read.isError()) {
2364 return Error(read.error());
2365 }
2366
2367 Try<Bytes> bytes = Bytes::parse(strings::trim(read.get()) + "B");
2368
2369 if (bytes.isError()) {
2370 return Error(bytes.error());
2371 }
2372
2373 return bytes.get();
2374}
2375
2376
2377Try<bool> memsw_limit_in_bytes(

Callers 3

TEST_FFunction · 0.85
createMethod · 0.85
updateMethod · 0.85

Calls 12

NoneClass · 0.85
trimFunction · 0.85
existsFunction · 0.70
readFunction · 0.70
parseFunction · 0.70
writeFunction · 0.70
stringifyFunction · 0.70
errorMethod · 0.65
ErrorFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45
bytesMethod · 0.45

Tested by 1

TEST_FFunction · 0.68