> On April 6, 2016, 11:55 a.m., Vinod Kone wrote: > > src/examples/long_lived_framework.cpp, line 241 > > <https://reviews.apache.org/r/45440/diff/2/?file=1326914#file1326914line241> > > > > Looking at the code below I think it makes more sense to make > > LongLivedScheduler an instance of process instead of making Metrics a > > process? That is consistent with how we did it elsewhere in the code base > > (e.g., Master and Slave).
I added the sub-class because the `LongLivedScheduler` already inherits from `Scheduler`, which does not expect a libprocess process. And multiple inheritance seemed like a bad idea. > On April 6, 2016, 11:55 a.m., Vinod Kone wrote: > > src/examples/long_lived_framework.cpp, line 244 > > <https://reviews.apache.org/r/45440/diff/2/?file=1326914#file1326914line244> > > > > why is the process based call "framework" here? I wanted a proper name for the special metadata endpoint `/framework/counters`. If I didn't add this, the endpoint would be `/(1)/counters`. > On April 6, 2016, 11:55 a.m., Vinod Kone wrote: > > src/examples/long_lived_framework.cpp, line 272 > > <https://reviews.apache.org/r/45440/diff/2/?file=1326914#file1326914line272> > > > > s/counter/metrics/ > > > > I'm assuming you might want to add gauge type metrics to this endpoint > > in the future? > > > > More importantly, I didn't understand why you need to add a special > > endpoint for these 2 counters. Why can't they just be part of the > > "/metrics/snapshot" endpoint like the other metrics? This endpoint's sole purpose is to specify which metrics are `Counters`. We still get the metric values from `/metrics/snapshot`, but it can also call this endpoint to decide which metrics to treat as counters. > On April 6, 2016, 11:55 a.m., Vinod Kone wrote: > > src/examples/long_lived_framework.cpp, lines 298-313 > > <https://reviews.apache.org/r/45440/diff/2/?file=1326914#file1326914line298> > > > > seems a bit weird that these are part of the metrics class. In Master > > and Slave, we made these gauges part of the Master and Slave class instead. I can't put these methods in a non-libprocess-process class since they are called via `defer` by the gauges. - Joseph ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/45440/#review127404 ----------------------------------------------------------- On April 5, 2016, 3:33 p.m., Joseph Wu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/45440/ > ----------------------------------------------------------- > > (Updated April 5, 2016, 3:33 p.m.) > > > Review request for mesos, Greg Mann, Artem Harutyunyan, Kevin Klues, and > Vinod Kone. > > > Bugs: MESOS-5062 > https://issues.apache.org/jira/browse/MESOS-5062 > > > Repository: mesos > > > Description > ------- > > Adds metrics to gauge the health of the framework. This includes: > > * uptime_secs = How long the framework has been running. > * registered = If the framework is registered. > * offers_received = A counter used to determine if the framework is starved > or not. > * tasks_launched = Number of tasks launched. > * abnormal_terminations = Number of terminal status updates which were not > `TASK_FINISHED`. > > Also adds an endpoint `/framework/counters` which returns the list of metrics > which are "counters". > > > Diffs > ----- > > src/examples/long_lived_framework.cpp > ef498d63bc5f0a8deb46d71edd85a76a1d38fdd0 > > Diff: https://reviews.apache.org/r/45440/diff/ > > > Testing > ------- > > make check > > Also deployed this version on a test cluster. See the previous review. > > > Thanks, > > Joseph Wu > >