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

Class Counter

src/linux/cgroups.hpp:883–909  ·  view source on GitHub ↗

Counter is a primitive to listen on events of a given memory pressure level for a cgroup and keep track of the number of occurrence of that event. Use the public 'create' function to create a new counter; see 'value' for how to use.

Source from the content-addressed store, hash-verified

881// occurrence of that event. Use the public 'create' function to
882// create a new counter; see 'value' for how to use.
883class Counter
884{
885public:
886 // Create a memory pressure counter for the given cgroup on the
887 // specified level. This function assumes the given hierarchy and
888 // cgroup are valid.
889 static Try<process::Owned<Counter>> create(
890 const std::string& hierarchy,
891 const std::string& cgroup,
892 Level level);
893
894 virtual ~Counter();
895
896 // Returns the current accumulated number of occurrences of the
897 // pressure event. Returns a failure if any error occurs while
898 // monitoring the pressure events, and any subsequent calls to
899 // 'value' will return the same failure. In such case, the user
900 // should consider creating a new Counter.
901 process::Future<uint64_t> value() const;
902
903private:
904 Counter(const std::string& hierarchy,
905 const std::string& cgroup,
906 Level level);
907
908 process::Owned<CounterProcess> process;
909};
910
911} // namespace pressure {
912

Callers 4

foreachFunction · 0.50
MetricsMethod · 0.50
incrementTasksStatesMethod · 0.50
FrameworkMetricsMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected