monitor for distributed envorinment. (#4829)

* Collect statistics from other ranks in monitor.

* Workaround old GCC bug.
This commit is contained in:
Jiaming Yuan
2019-09-05 13:18:09 +08:00
committed by GitHub
parent c0fbeff0ab
commit 52d44e07fe
5 changed files with 151 additions and 21 deletions

View File

@@ -162,6 +162,10 @@ class JsonNumber : public Value {
JsonNumber(FloatT value) : Value(ValueKind::Number) { // NOLINT
number_ = value;
}
template <typename FloatT,
typename std::enable_if<std::is_same<FloatT, double>::value>::type* = nullptr>
JsonNumber(FloatT value) : Value{ValueKind::Number}, // NOLINT
number_{static_cast<Float>(value)} {}
void Save(JsonWriter* writer) override;
@@ -193,6 +197,10 @@ class JsonInteger : public Value {
template <typename IntT,
typename std::enable_if<std::is_same<IntT, Int>::value>::type* = nullptr>
JsonInteger(IntT value) : Value(ValueKind::Integer), integer_{value} {} // NOLINT
template <typename IntT,
typename std::enable_if<std::is_same<IntT, size_t>::value>::type* = nullptr>
JsonInteger(IntT value) : Value(ValueKind::Integer), // NOLINT
integer_{static_cast<Int>(value)} {}
Json& operator[](std::string const & key) override;
Json& operator[](int ind) override;