> On May 8, 2018, 1:33 p.m., Gaston Kleiman wrote: > > src/master/metrics.cpp > > Lines 595-623 (patched) > > <https://reviews.apache.org/r/66822/diff/4/?file=2014731#file2014731line595> > > > > We could replace these two methods with a single method that that takes > > a `const scheduler::Call::Type&` instead of a `const scheduler::Call&`. > > > > We use this pattern for a lot of metrics, so should consider adding > > something like: > > > > ``` > > template <typename Type> > > class EnumCounter > > { > > EnumCounter(const lambda::function<std::string(const Type&)> > > _keyNameGenerator); > > > > ~EnumCounter(); > > > > void increment(const Type& type); > > > > private: > > hashmap<Type, Counter> counters; > > const lambda::function<std::string(const Type&)> keyNameGenerator; > > } > > ```
Unified these two. Do we want to introduce such a template class now? Consdiering it may be consumed by multiple metrics, maybe we should add it when refactoring all. - Gilbert ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/66822/#review202680 ----------------------------------------------------------- On May 11, 2018, 12:25 a.m., Gilbert Song wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/66822/ > ----------------------------------------------------------- > > (Updated May 11, 2018, 12:25 a.m.) > > > Review request for mesos, Benjamin Mahler, Gaston Kleiman, Greg Mann, Jie Yu, > and Vinod Kone. > > > Repository: mesos > > > Description > ------- > > Added per Framework Calls to metrics. > > > Diffs > ----- > > src/master/http.cpp 0492b979e4657a489ca3428e6f8022ef20cb05f5 > src/master/master.cpp 41862db9900acde85a62d2fea85459691c68556e > src/master/metrics.hpp ec76dbcd1d1fa5349d62ce73fb9603e1986a776b > src/master/metrics.cpp e46ead79f3f29e285426f9d061337077f453aa45 > > > Diff: https://reviews.apache.org/r/66822/diff/5/ > > > Testing > ------- > > > Thanks, > > Gilbert Song > >
