----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/65665/#review199657 -----------------------------------------------------------
src/resource_provider/storage/provider.cpp Line 493 (original), 498 (patched) <https://reviews.apache.org/r/65665/#comment280017> Nit: This seems superfluous. `Provider` is only used twice. src/resource_provider/storage/provider.cpp Lines 503 (patched) <https://reviews.apache.org/r/65665/#comment280016> As this is only used as a helper in the constructor of `Metrics`, how about introducing a small helper function instead of leaking this implementation detail? src/resource_provider/storage/provider.cpp Lines 2713 (patched) <https://reviews.apache.org/r/65665/#comment280034> `statusUpdateManager.update` below might still fail to drop the message. In that case we would count the operation as dropped in metrics when we increment here. Increment in an `onReady` handler instead. src/resource_provider/storage/provider.cpp Lines 3058-3062 (patched) <https://reviews.apache.org/r/65665/#comment280021> Please reformat as per style guide: ``` switch (operation.latest_status().state()) { case OPERATION_FINISHED: metrics.operations_finished++; break; case OPERATION_FAILED: metrics.operations_failed++; break; default: UNREACHABLE(); } ``` src/resource_provider/storage/provider.cpp Lines 3249-3250 (patched) <https://reviews.apache.org/r/65665/#comment280028> See remarks above for the use of `prefix` here. We could use a helper `createPrefix(provider, "metric_name")` instead and don't need a `prefix` member. - Jan Schlicht On March 20, 2018, 4:24 a.m., Chun-Hung Hsiao wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/65665/ > ----------------------------------------------------------- > > (Updated March 20, 2018, 4:24 a.m.) > > > Review request for mesos, Benjamin Bannier, Greg Mann, Jie Yu, and Jan > Schlicht. > > > Bugs: MESOS-8383 > https://issues.apache.org/jira/browse/MESOS-8383 > > > Repository: mesos > > > Description > ------- > > This patch adds `operations_pending`, `operations_finished`, > `operations_failed`, `operations_error` (currently unused), and > `operations_dropped` metrics to count the occurances of these operation > states. > > Additionally, An error log in `_applyOperation()` is removed because the > error is already logged at the call site. > > > Diffs > ----- > > src/resource_provider/storage/provider.cpp > bb19ed4b6b1b8f5f6b327461a737517497c8c38e > > > Diff: https://reviews.apache.org/r/65665/diff/3/ > > > Testing > ------- > > sudo make check > A unit test is added in the next patch in chain. > > > Thanks, > > Chun-Hung Hsiao > >