You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Greg Mann <gr...@mesosphere.io> on 2018/07/10 06:20:41 UTC

Review Request 67871: Optimized the generation of metrics snapshots.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/
-----------------------------------------------------------

Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.


Repository: mesos


Description
-------

Optimized the generation of metrics snapshots.


Diffs
-----

  3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
  3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 


Diff: https://reviews.apache.org/r/67871/diff/1/


Testing
-------


Thanks,

Greg Mann


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review205930
-----------------------------------------------------------



Forgot to mention this, can you include more information in the summary and description?

E.g.

```
Optimized metric snapshot generation to reduce hashmap/map cost.

This uses vector in place of hashmaps since we iterate in order
and do not need to perform lookups in the ...

Also, this hints when inserting into std::map to reduce the
insertion cost.
```

- Benjamin Mahler


On July 10, 2018, 6:21 a.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 10, 2018, 6:21 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Optimized the generation of metrics snapshots.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/1/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Greg Mann <gr...@mesosphere.io>.

> On July 10, 2018, 4:21 p.m., James Peach wrote:
> > 3rdparty/libprocess/src/metrics/metrics.cpp
> > Lines 158 (patched)
> > <https://reviews.apache.org/r/67871/diff/1/?file=2057377#file2057377line159>
> >
> >     Since we are optimizing, shall we do `++iter`?

Yep, thx!


- Greg


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review205915
-----------------------------------------------------------


On July 12, 2018, 8:10 p.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 12, 2018, 8:10 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Profiling of metrics generation revealed a large amount of time spent
> in map operations. This patch does three things to mitigate this:
> 
>  * Stores the metrics as an ordered map so that we only pay the price
>    of sorting when the metric is first added.
>  * Makes use of vectors instead of maps for intermediate objects,
>    which eliminates the need for another intermediate object.
>  * Hints when inserting into the returned map, reducing the cost of
>    insertion into that ordered container.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/2/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review205915
-----------------------------------------------------------


Ship it!





3rdparty/libprocess/src/metrics/metrics.cpp
Lines 158 (patched)
<https://reviews.apache.org/r/67871/#comment288845>

    Since we are optimizing, shall we do `++iter`?


- James Peach


On July 10, 2018, 6:21 a.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 10, 2018, 6:21 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Optimized the generation of metrics snapshots.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/1/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Greg Mann <gr...@mesosphere.io>.

> On July 10, 2018, 7:26 p.m., Benjamin Mahler wrote:
> > 3rdparty/libprocess/src/metrics/metrics.cpp
> > Lines 148-153 (original), 147-152 (patched)
> > <https://reviews.apache.org/r/67871/diff/1/?file=2057377#file2057377line148>
> >
> >     You may want to try comparing this against a single vector of tuple, but definitely can do that as a follow up.

If we used a vector of tuples, would we still be able to call `await()` without creating a new object?


- Greg


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review205929
-----------------------------------------------------------


On July 10, 2018, 6:21 a.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 10, 2018, 6:21 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Optimized the generation of metrics snapshots.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/1/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review205929
-----------------------------------------------------------


Fix it, then Ship it!




Thanks Greg! At some point we need a simpler benchmark in libprocess to iterate on library improvements more quickly.


3rdparty/libprocess/src/metrics/metrics.cpp
Lines 148-153 (original), 147-152 (patched)
<https://reviews.apache.org/r/67871/#comment288858>

    You may want to try comparing this against a single vector of tuple, but definitely can do that as a follow up.



3rdparty/libprocess/src/metrics/metrics.cpp
Line 217 (original), 223 (patched)
<https://reviews.apache.org/r/67871/#comment288859>

    We should probably pre-increment as a pattern in all for loops, it doesn't matter here, but it matters in iterator loops as james pointed out (unless compilers are able to optimize it :)).



3rdparty/libprocess/src/metrics/metrics.cpp
Lines 226-227 (patched)
<https://reviews.apache.org/r/67871/#comment288860>

    Why non-const here?


- Benjamin Mahler


On July 10, 2018, 6:21 a.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 10, 2018, 6:21 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Optimized the generation of metrics snapshots.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/1/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/
-----------------------------------------------------------

(Updated July 17, 2018, 8:36 p.m.)


Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.


Bugs: MESOS-9072
    https://issues.apache.org/jira/browse/MESOS-9072


Repository: mesos


Description
-------

Profiling of metrics generation revealed a large amount of time spent
in map operations. This patch does three things to mitigate this:

 * Stores the metrics as an ordered map so that we only pay the price
   of sorting when the metric is first added.
 * Makes use of vectors instead of maps for intermediate objects,
   which eliminates the need for another intermediate object.
 * Hints when inserting into the returned map, reducing the cost of
   insertion into that ordered container.


Diffs
-----

  3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
  3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 


Diff: https://reviews.apache.org/r/67871/diff/5/


Testing
-------

WITH per-framework metrics, BEFORE optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 157.1449ms
v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
v1 'master::call::GetMetrics' application/json response took 198.918334ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 1.319444199secs
v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
v1 'master::call::GetMetrics' application/json response took 1.527225235secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 15.479365874secs
v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
v1 'master::call::GetMetrics' application/json response took 18.05492789secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 31.908301664secs
v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
v1 'master::call::GetMetrics' application/json response took 33.669376185secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
```

WITH per-framework metrics, AFTER optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 104.577895ms
v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
v1 'master::call::GetMetrics' application/json response took 100.218618ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 921.175877ms
v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
v1 'master::call::GetMetrics' application/json response took 1.168651111secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 10.2413387secs
v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
v1 'master::call::GetMetrics' application/json response took 10.582584848secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 19.930542079secs
v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
v1 'master::call::GetMetrics' application/json response took 22.853630899secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
```


Thanks,

Greg Mann


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/
-----------------------------------------------------------

(Updated July 17, 2018, 8:33 p.m.)


Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.


Repository: mesos


Description
-------

Profiling of metrics generation revealed a large amount of time spent
in map operations. This patch does three things to mitigate this:

 * Stores the metrics as an ordered map so that we only pay the price
   of sorting when the metric is first added.
 * Makes use of vectors instead of maps for intermediate objects,
   which eliminates the need for another intermediate object.
 * Hints when inserting into the returned map, reducing the cost of
   insertion into that ordered container.


Diffs (updated)
-----

  3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
  3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 


Diff: https://reviews.apache.org/r/67871/diff/5/

Changes: https://reviews.apache.org/r/67871/diff/4-5/


Testing
-------

WITH per-framework metrics, BEFORE optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 157.1449ms
v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
v1 'master::call::GetMetrics' application/json response took 198.918334ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 1.319444199secs
v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
v1 'master::call::GetMetrics' application/json response took 1.527225235secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 15.479365874secs
v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
v1 'master::call::GetMetrics' application/json response took 18.05492789secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 31.908301664secs
v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
v1 'master::call::GetMetrics' application/json response took 33.669376185secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
```

WITH per-framework metrics, AFTER optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 104.577895ms
v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
v1 'master::call::GetMetrics' application/json response took 100.218618ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 921.175877ms
v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
v1 'master::call::GetMetrics' application/json response took 1.168651111secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 10.2413387secs
v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
v1 'master::call::GetMetrics' application/json response took 10.582584848secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 19.930542079secs
v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
v1 'master::call::GetMetrics' application/json response took 22.853630899secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
```


Thanks,

Greg Mann


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Greg Mann <gr...@mesosphere.io>.

> On July 16, 2018, 7:46 p.m., Benjamin Mahler wrote:
> > 3rdparty/libprocess/src/metrics/metrics.cpp
> > Lines 174 (patched)
> > <https://reviews.apache.org/r/67871/diff/3-4/?file=2059029#file2059029line174>
> >
> >     How about s/result/waited/?

SGTM


- Greg


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review206118
-----------------------------------------------------------


On July 17, 2018, 8:33 p.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 17, 2018, 8:33 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Profiling of metrics generation revealed a large amount of time spent
> in map operations. This patch does three things to mitigate this:
> 
>  * Stores the metrics as an ordered map so that we only pay the price
>    of sorting when the metric is first added.
>  * Makes use of vectors instead of maps for intermediate objects,
>    which eliminates the need for another intermediate object.
>  * Hints when inserting into the returned map, reducing the cost of
>    insertion into that ordered container.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/5/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review206118
-----------------------------------------------------------


Fix it, then Ship it!





3rdparty/libprocess/src/metrics/metrics.cpp
Lines 174 (patched)
<https://reviews.apache.org/r/67871/#comment289030>

    How about s/result/waited/?


- Benjamin Mahler


On July 16, 2018, 4:34 p.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 16, 2018, 4:34 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Profiling of metrics generation revealed a large amount of time spent
> in map operations. This patch does three things to mitigate this:
> 
>  * Stores the metrics as an ordered map so that we only pay the price
>    of sorting when the metric is first added.
>  * Makes use of vectors instead of maps for intermediate objects,
>    which eliminates the need for another intermediate object.
>  * Hints when inserting into the returned map, reducing the cost of
>    insertion into that ordered container.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/4/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review206116
-----------------------------------------------------------



PASS: Mesos patch 67871 was successfully built and tested.

Reviews applied: `['67871']`

All the build artifacts available at: http://dcos-win.westus.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/1934/mesos-review-67871

- Mesos Reviewbot Windows


On July 16, 2018, 9:34 a.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 16, 2018, 9:34 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Profiling of metrics generation revealed a large amount of time spent
> in map operations. This patch does three things to mitigate this:
> 
>  * Stores the metrics as an ordered map so that we only pay the price
>    of sorting when the metric is first added.
>  * Makes use of vectors instead of maps for intermediate objects,
>    which eliminates the need for another intermediate object.
>  * Hints when inserting into the returned map, reducing the cost of
>    insertion into that ordered container.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/4/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/
-----------------------------------------------------------

(Updated July 16, 2018, 4:34 p.m.)


Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.


Repository: mesos


Description
-------

Profiling of metrics generation revealed a large amount of time spent
in map operations. This patch does three things to mitigate this:

 * Stores the metrics as an ordered map so that we only pay the price
   of sorting when the metric is first added.
 * Makes use of vectors instead of maps for intermediate objects,
   which eliminates the need for another intermediate object.
 * Hints when inserting into the returned map, reducing the cost of
   insertion into that ordered container.


Diffs (updated)
-----

  3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
  3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 


Diff: https://reviews.apache.org/r/67871/diff/4/

Changes: https://reviews.apache.org/r/67871/diff/3-4/


Testing
-------

WITH per-framework metrics, BEFORE optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 157.1449ms
v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
v1 'master::call::GetMetrics' application/json response took 198.918334ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 1.319444199secs
v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
v1 'master::call::GetMetrics' application/json response took 1.527225235secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 15.479365874secs
v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
v1 'master::call::GetMetrics' application/json response took 18.05492789secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 31.908301664secs
v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
v1 'master::call::GetMetrics' application/json response took 33.669376185secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
```

WITH per-framework metrics, AFTER optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 104.577895ms
v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
v1 'master::call::GetMetrics' application/json response took 100.218618ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 921.175877ms
v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
v1 'master::call::GetMetrics' application/json response took 1.168651111secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 10.2413387secs
v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
v1 'master::call::GetMetrics' application/json response took 10.582584848secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 19.930542079secs
v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
v1 'master::call::GetMetrics' application/json response took 22.853630899secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
```


Thanks,

Greg Mann


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review206029
-----------------------------------------------------------



PASS: Mesos patch 67871 was successfully built and tested.

Reviews applied: `['67870', '67871']`

All the build artifacts available at: http://dcos-win.westus.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/1912/mesos-review-67871

- Mesos Reviewbot Windows


On July 12, 2018, 9:39 p.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 12, 2018, 9:39 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Profiling of metrics generation revealed a large amount of time spent
> in map operations. This patch does three things to mitigate this:
> 
>  * Stores the metrics as an ordered map so that we only pay the price
>    of sorting when the metric is first added.
>  * Makes use of vectors instead of maps for intermediate objects,
>    which eliminates the need for another intermediate object.
>  * Hints when inserting into the returned map, reducing the cost of
>    insertion into that ordered container.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/3/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Greg Mann <gr...@mesosphere.io>.

> On July 14, 2018, 7:54 p.m., Benjamin Mahler wrote:
> > 3rdparty/libprocess/src/metrics/metrics.cpp
> > Lines 164-172 (original), 168-177 (patched)
> > <https://reviews.apache.org/r/67871/diff/3/?file=2059029#file2059029line171>
> >
> >     Whoops, this expression contains both a moving and use of `futures` and the evaluation order is undefined: 
> >     
> >     https://en.cppreference.com/w/cpp/language/eval_order
> >     
> >     If the compiler decides to evaluate defer before await, await will see an empty vector and we'll likely see the timeout CHECK fail if no timeout was passed.
> >     
> >     I've been tripped up by this a bunch of times with moves, and one of those times was exactly in this spot!
> >     
> >     https://issues.apache.org/jira/browse/MESOS-8970

lol, thanks for catching this Ben!! Much appreciated :) I've pushed an update to ensure our desired order of evaluation.


- Greg


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review206090
-----------------------------------------------------------


On July 16, 2018, 4:34 p.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 16, 2018, 4:34 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Profiling of metrics generation revealed a large amount of time spent
> in map operations. This patch does three things to mitigate this:
> 
>  * Stores the metrics as an ordered map so that we only pay the price
>    of sorting when the metric is first added.
>  * Makes use of vectors instead of maps for intermediate objects,
>    which eliminates the need for another intermediate object.
>  * Hints when inserting into the returned map, reducing the cost of
>    insertion into that ordered container.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/4/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review206090
-----------------------------------------------------------




3rdparty/libprocess/src/metrics/metrics.cpp
Lines 164-172 (original), 168-177 (patched)
<https://reviews.apache.org/r/67871/#comment289022>

    Whoops, this expression contains both a moving and use of `futures` and the evaluation order is undefined: 
    
    https://en.cppreference.com/w/cpp/language/eval_order
    
    If the compiler decides to evaluate defer before await, await will see an empty vector and we'll likely see the timeout CHECK fail if no timeout was passed.
    
    I've been tripped up by this a bunch of times with moves, and one of those times was exactly in this spot!
    
    https://issues.apache.org/jira/browse/MESOS-8970


- Benjamin Mahler


On July 12, 2018, 9:39 p.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 12, 2018, 9:39 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Profiling of metrics generation revealed a large amount of time spent
> in map operations. This patch does three things to mitigate this:
> 
>  * Stores the metrics as an ordered map so that we only pay the price
>    of sorting when the metric is first added.
>  * Makes use of vectors instead of maps for intermediate objects,
>    which eliminates the need for another intermediate object.
>  * Hints when inserting into the returned map, reducing the cost of
>    insertion into that ordered container.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/3/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/
-----------------------------------------------------------

(Updated July 12, 2018, 9:39 p.m.)


Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.


Repository: mesos


Description
-------

Profiling of metrics generation revealed a large amount of time spent
in map operations. This patch does three things to mitigate this:

 * Stores the metrics as an ordered map so that we only pay the price
   of sorting when the metric is first added.
 * Makes use of vectors instead of maps for intermediate objects,
   which eliminates the need for another intermediate object.
 * Hints when inserting into the returned map, reducing the cost of
   insertion into that ordered container.


Diffs (updated)
-----

  3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
  3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 


Diff: https://reviews.apache.org/r/67871/diff/3/

Changes: https://reviews.apache.org/r/67871/diff/2-3/


Testing
-------

WITH per-framework metrics, BEFORE optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 157.1449ms
v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
v1 'master::call::GetMetrics' application/json response took 198.918334ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 1.319444199secs
v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
v1 'master::call::GetMetrics' application/json response took 1.527225235secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 15.479365874secs
v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
v1 'master::call::GetMetrics' application/json response took 18.05492789secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 31.908301664secs
v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
v1 'master::call::GetMetrics' application/json response took 33.669376185secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
```

WITH per-framework metrics, AFTER optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 104.577895ms
v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
v1 'master::call::GetMetrics' application/json response took 100.218618ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 921.175877ms
v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
v1 'master::call::GetMetrics' application/json response took 1.168651111secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 10.2413387secs
v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
v1 'master::call::GetMetrics' application/json response took 10.582584848secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 19.930542079secs
v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
v1 'master::call::GetMetrics' application/json response took 22.853630899secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
```


Thanks,

Greg Mann


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/
-----------------------------------------------------------

(Updated July 12, 2018, 8:10 p.m.)


Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.


Repository: mesos


Description (updated)
-------

Profiling of metrics generation revealed a large amount of time spent
in map operations. This patch does three things to mitigate this:

 * Stores the metrics as an ordered map so that we only pay the price
   of sorting when the metric is first added.
 * Makes use of vectors instead of maps for intermediate objects,
   which eliminates the need for another intermediate object.
 * Hints when inserting into the returned map, reducing the cost of
   insertion into that ordered container.


Diffs (updated)
-----

  3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
  3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 


Diff: https://reviews.apache.org/r/67871/diff/2/

Changes: https://reviews.apache.org/r/67871/diff/1-2/


Testing
-------

WITH per-framework metrics, BEFORE optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 157.1449ms
v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
v1 'master::call::GetMetrics' application/json response took 198.918334ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 1.319444199secs
v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
v1 'master::call::GetMetrics' application/json response took 1.527225235secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 15.479365874secs
v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
v1 'master::call::GetMetrics' application/json response took 18.05492789secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 31.908301664secs
v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
v1 'master::call::GetMetrics' application/json response took 33.669376185secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
```

WITH per-framework metrics, AFTER optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 104.577895ms
v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
v1 'master::call::GetMetrics' application/json response took 100.218618ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 921.175877ms
v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
v1 'master::call::GetMetrics' application/json response took 1.168651111secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 10.2413387secs
v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
v1 'master::call::GetMetrics' application/json response took 10.582584848secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 19.930542079secs
v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
v1 'master::call::GetMetrics' application/json response took 22.853630899secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
```


Thanks,

Greg Mann


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Mesos Reviewbot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review205942
-----------------------------------------------------------



Bad patch!

Reviews applied: [67871, 67870, 67823, 67235, 67187, 67878, 66870, 66856, 66861, 66855, 66844, 67147, 66843, 66842, 66841, 67814, 67813, 67812, 67809, 67776, 66820, 66819, 67875]

Failed command: python support/apply-reviews.py -n -r 66819

Error:
The support scripts will be upgraded to Python 3 by July 1st.
Make sure to install Python 3.6 on your machine before.
2018-07-10 22:19:19 URL:https://reviews.apache.org/r/66819/diff/raw/ [2095/2095] -> "66819.patch" [1]
error: patch failed: src/master/metrics.cpp:546
error: src/master/metrics.cpp: patch does not apply

Full log: https://builds.apache.org/job/Mesos-Reviewbot/22879/console

- Mesos Reviewbot


On July 10, 2018, 6:21 a.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 10, 2018, 6:21 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Optimized the generation of metrics snapshots.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/1/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/#review205896
-----------------------------------------------------------



FAIL: Failed to apply the dependent review: 67813.

Failed command: `python.exe .\support\python3\apply-reviews.py -n -r 67813`

All the build artifacts available at: http://dcos-win.westus.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/1894/mesos-review-67871

Relevant logs:

- [apply-review-67813-stdout.log](http://dcos-win.westus.cloudapp.azure.com/artifacts/mesos-reviewbot-testing/1894/mesos-review-67871/logs/apply-review-67813-stdout.log):

```
error: patch failed: src/master/metrics.cpp:630
error: src/master/metrics.cpp: patch does not apply
```

- Mesos Reviewbot Windows


On July 10, 2018, 6:21 a.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67871/
> -----------------------------------------------------------
> 
> (Updated July 10, 2018, 6:21 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Optimized the generation of metrics snapshots.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
>   3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 
> 
> 
> Diff: https://reviews.apache.org/r/67871/diff/1/
> 
> 
> Testing
> -------
> 
> WITH per-framework metrics, BEFORE optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 157.1449ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
> v1 'master::call::GetMetrics' application/json response took 198.918334ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 1.319444199secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
> v1 'master::call::GetMetrics' application/json response took 1.527225235secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 15.479365874secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
> v1 'master::call::GetMetrics' application/json response took 18.05492789secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 31.908301664secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
> v1 'master::call::GetMetrics' application/json response took 33.669376185secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
> ```
> 
> WITH per-framework metrics, AFTER optimizations:
> ```
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
> Test setup: 1 agents with a total of 105 frameworks
> unversioned /metrics/snapshot' response took 104.577895ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
> v1 'master::call::GetMetrics' application/json response took 100.218618ms
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
> Test setup: 1 agents with a total of 1005 frameworks
> unversioned /metrics/snapshot' response took 921.175877ms
> v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
> v1 'master::call::GetMetrics' application/json response took 1.168651111secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
> Test setup: 1 agents with a total of 10005 frameworks
> unversioned /metrics/snapshot' response took 10.2413387secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
> v1 'master::call::GetMetrics' application/json response took 10.582584848secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
> [ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
> Test setup: 1 agents with a total of 20005 frameworks
> unversioned /metrics/snapshot' response took 19.930542079secs
> v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
> v1 'master::call::GetMetrics' application/json response took 22.853630899secs
> [       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
> ```
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Re: Review Request 67871: Optimized the generation of metrics snapshots.

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67871/
-----------------------------------------------------------

(Updated July 10, 2018, 6:21 a.m.)


Review request for mesos, Benjamin Mahler, Gastón Kleiman, and James Peach.


Repository: mesos


Description
-------

Optimized the generation of metrics snapshots.


Diffs
-----

  3rdparty/libprocess/include/process/metrics/metrics.hpp f9b72029b2c85826c91b1d7656b0af94dc87010c 
  3rdparty/libprocess/src/metrics/metrics.cpp 4883c9acaa0cc568e27944661a8208f7b2a356a1 


Diff: https://reviews.apache.org/r/67871/diff/1/


Testing (updated)
-------

WITH per-framework metrics, BEFORE optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 157.1449ms
v1 'master::call::GetMetrics' application/x-protobuf response took 152.599692ms
v1 'master::call::GetMetrics' application/json response took 198.918334ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (835 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 1.319444199secs
v1 'master::call::GetMetrics' application/x-protobuf response took 1.257644596secs
v1 'master::call::GetMetrics' application/json response took 1.527225235secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (6553 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 15.479365874secs
v1 'master::call::GetMetrics' application/x-protobuf response took 14.542866983secs
v1 'master::call::GetMetrics' application/json response took 18.05492789secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (75455 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 31.908301664secs
v1 'master::call::GetMetrics' application/x-protobuf response took 32.128689785secs
v1 'master::call::GetMetrics' application/json response took 33.669376185secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (150440 ms)
```

WITH per-framework metrics, AFTER optimizations:
```
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0
Test setup: 1 agents with a total of 105 frameworks
unversioned /metrics/snapshot' response took 104.577895ms
v1 'master::call::GetMetrics' application/x-protobuf response took 74.262533ms
v1 'master::call::GetMetrics' application/json response took 100.218618ms
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/0 (562 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1
Test setup: 1 agents with a total of 1005 frameworks
unversioned /metrics/snapshot' response took 921.175877ms
v1 'master::call::GetMetrics' application/x-protobuf response took 780.277639ms
v1 'master::call::GetMetrics' application/json response took 1.168651111secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/1 (5424 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2
Test setup: 1 agents with a total of 10005 frameworks
unversioned /metrics/snapshot' response took 10.2413387secs
v1 'master::call::GetMetrics' application/x-protobuf response took 9.407992945secs
v1 'master::call::GetMetrics' application/json response took 10.582584848secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/2 (57206 ms)
[ RUN      ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3
Test setup: 1 agents with a total of 20005 frameworks
unversioned /metrics/snapshot' response took 19.930542079secs
v1 'master::call::GetMetrics' application/x-protobuf response took 20.318739763secs
v1 'master::call::GetMetrics' application/json response took 22.853630899secs
[       OK ] AgentFrameworkTaskCountContentType/MasterMetricsQuery_BENCHMARK_Test.GetMetrics/3 (116363 ms)
```


Thanks,

Greg Mann