Re: Review Request 50205: Enhanced benchmark test for resources to include shared resources.

2016-08-02 Thread Jiang Yan Xu

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


Ship it!




The test itself LGTM so I'll commit it. However when I ran it it does show some 
performance regression on the basic scalars.

## Head
Resources benchmark on top of 6ce156b2bed7edecb27ce50f68d262ea4ab4f88e

```
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
Took 72228us to perform 5 'total += r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 101574us to perform 5 'total -= r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 251715us to perform 5 'total = total + r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
Took 293414us to perform 5 'total = total - r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
```

## Pre-shared resources
Resources benchmark on top of 48a492cd9d7d0a194735b9b4107a35b489c596e1

```
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
Took 48583us to perform 5 'total += r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 86166us to perform 5 'total -= r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 233148us to perform 5 'total = total + r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
Took 265719us to perform 5 'total = total - r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
```

'total += r' run time sees 40% jump. (I've run these 10 times and took an 
average, the avg is 48685.4us (pre-shared resources) vs. 68421.7us (post-shared 
resources).

The overhead seems to be due we call `addable()` and `subtractable()` twice for 
'total += r' and 'total -= r'. After I remove one of the calls, the numbers 
become:

Resources benchmarks on top of 6ce156b2bed7edecb27ce50f68d262ea4ab4f88e but 
with addable()/subtractable() tweaks
```
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
Took 48955us to perform 5 'total += r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 85126us to perform 5 'total -= r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 226796us to perform 5 'total = total + r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
Took 266480us to perform 5 'total = total - r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
```

Let's address this issue. :)

- Jiang Yan Xu


On July 30, 2016, 12:03 a.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50205/
> ---
> 
> (Updated July 30, 2016, 12:03 a.m.)
> 
> 
> Review request for mesos, Klaus Ma and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4892
> https://issues.apache.org/jira/browse/MESOS-4892
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced benchmark test for resources to include shared resources.
> 
> 
> Diffs
> -
> 
>   src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 
> 
> Diff: https://reviews.apache.org/r/50205/diff/
> 
> 
> Testing
> ---
> 
> Tests passed. Results for resources benchmark is as follows:
> 
> Minimal impact seen in Resources arithmetic with the Resources refactor 
> changes to incorporate shared resources.
> 
> With shared resources patch (note that 4th test below is for shared resources 
> for scalars)
> 
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (806 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17032 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1048 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (940 ms)
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (19826 
> ms total)
> 
> HEAD
> 
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (726 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17413 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1026 
> ms)
> [--] 3 tests 

Re: Review Request 50205: Enhanced benchmark test for resources to include shared resources.

2016-08-02 Thread Guangya Liu


> On 七月 29, 2016, 1:43 a.m., Guangya Liu wrote:
> > src/tests/resources_tests.cpp, lines 2480-2487
> > 
> >
> > I prefer that you adjust the position of `shared` to the place where it 
> > was used.
> > 
> > ```
> > // Test a typical vector of scalars which include shared resources
> > // (viz, shared persistent volumes).
> > Resource disk = createDiskResource(
> > "256", "test", "persistentId", "/volume", None(), true);
> > 
> > Parameter shared;
> > shared.resources = Resources::parse("cpus:1;mem:128").get() + disk;
> > shared.totalOperations = 5;
> > ```
> 
> Anindya Sinha wrote:
> Both are equivalent, but I will change it so as to match the flow of 
> existing code in this function.
> 
> Jiang Yan Xu wrote:
> I don't think we need to do this. 
> 
> It's very clear as it is that `Parameter shared;` starts the section that 
> prepares the variable. The rest of the section fills in the variable's 
> members. The rest of the method is similar in this regard. The fact that 
> `disk` is defined separately is just for cosmetic reasons (we could have 
> inlined it but the indentation would look a bit awkward. 
> 
> This is different from the anti-pattern that defines the variable far 
> away from where it's first used (which results in poor readability).
> 
> Guangya Liu wrote:
> Thanks Jiang Yan and Anindya. I think that as long as we have a comment 
> here in L2480 and L2481, then it should be ok to move the `Parameter shared;` 
> to the code where it first used (right before L2486). This can also make the 
> style consistent with here 
> https://github.com/apache/mesos/blob/master/src/tests/resources_tests.cpp#L2654-L2664
> 
> Anindya Sinha wrote:
> Based on the original comment, I had updated to move `Parameter shared` 
> down where it was used. Although I indicated that both are equivalent but now 
> that the code has been updated, I think we can settle on as it exists right 
> now.

Yeah, thanks Anindya.


- Guangya


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


On 七月 30, 2016, 7:03 a.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50205/
> ---
> 
> (Updated 七月 30, 2016, 7:03 a.m.)
> 
> 
> Review request for mesos, Klaus Ma and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4892
> https://issues.apache.org/jira/browse/MESOS-4892
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced benchmark test for resources to include shared resources.
> 
> 
> Diffs
> -
> 
>   src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 
> 
> Diff: https://reviews.apache.org/r/50205/diff/
> 
> 
> Testing
> ---
> 
> Tests passed. Results for resources benchmark is as follows:
> 
> Minimal impact seen in Resources arithmetic with the Resources refactor 
> changes to incorporate shared resources.
> 
> With shared resources patch (note that 4th test below is for shared resources 
> for scalars)
> 
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (806 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17032 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1048 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (940 ms)
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (19826 
> ms total)
> 
> HEAD
> 
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (726 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17413 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1026 
> ms)
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test (19165 
> ms total)
> 
> Output from stdout is:
> 
> [==] Running 4 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 4 tests from 

Re: Review Request 50205: Enhanced benchmark test for resources to include shared resources.

2016-08-02 Thread Anindya Sinha


> On July 29, 2016, 1:43 a.m., Guangya Liu wrote:
> > src/tests/resources_tests.cpp, lines 2480-2487
> > 
> >
> > I prefer that you adjust the position of `shared` to the place where it 
> > was used.
> > 
> > ```
> > // Test a typical vector of scalars which include shared resources
> > // (viz, shared persistent volumes).
> > Resource disk = createDiskResource(
> > "256", "test", "persistentId", "/volume", None(), true);
> > 
> > Parameter shared;
> > shared.resources = Resources::parse("cpus:1;mem:128").get() + disk;
> > shared.totalOperations = 5;
> > ```
> 
> Anindya Sinha wrote:
> Both are equivalent, but I will change it so as to match the flow of 
> existing code in this function.
> 
> Jiang Yan Xu wrote:
> I don't think we need to do this. 
> 
> It's very clear as it is that `Parameter shared;` starts the section that 
> prepares the variable. The rest of the section fills in the variable's 
> members. The rest of the method is similar in this regard. The fact that 
> `disk` is defined separately is just for cosmetic reasons (we could have 
> inlined it but the indentation would look a bit awkward. 
> 
> This is different from the anti-pattern that defines the variable far 
> away from where it's first used (which results in poor readability).
> 
> Guangya Liu wrote:
> Thanks Jiang Yan and Anindya. I think that as long as we have a comment 
> here in L2480 and L2481, then it should be ok to move the `Parameter shared;` 
> to the code where it first used (right before L2486). This can also make the 
> style consistent with here 
> https://github.com/apache/mesos/blob/master/src/tests/resources_tests.cpp#L2654-L2664

Based on the original comment, I had updated to move `Parameter shared` down 
where it was used. Although I indicated that both are equivalent but now that 
the code has been updated, I think we can settle on as it exists right now.


- Anindya


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


On July 30, 2016, 7:03 a.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50205/
> ---
> 
> (Updated July 30, 2016, 7:03 a.m.)
> 
> 
> Review request for mesos, Klaus Ma and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4892
> https://issues.apache.org/jira/browse/MESOS-4892
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced benchmark test for resources to include shared resources.
> 
> 
> Diffs
> -
> 
>   src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 
> 
> Diff: https://reviews.apache.org/r/50205/diff/
> 
> 
> Testing
> ---
> 
> Tests passed. Results for resources benchmark is as follows:
> 
> Minimal impact seen in Resources arithmetic with the Resources refactor 
> changes to incorporate shared resources.
> 
> With shared resources patch (note that 4th test below is for shared resources 
> for scalars)
> 
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (806 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17032 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1048 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (940 ms)
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (19826 
> ms total)
> 
> HEAD
> 
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (726 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17413 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1026 
> ms)
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test (19165 
> ms total)
> 
> Output from stdout is:
> 
> [==] Running 4 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] 

Re: Review Request 50205: Enhanced benchmark test for resources to include shared resources.

2016-08-01 Thread Guangya Liu


> On 七月 29, 2016, 1:43 a.m., Guangya Liu wrote:
> > src/tests/resources_tests.cpp, lines 2480-2487
> > 
> >
> > I prefer that you adjust the position of `shared` to the place where it 
> > was used.
> > 
> > ```
> > // Test a typical vector of scalars which include shared resources
> > // (viz, shared persistent volumes).
> > Resource disk = createDiskResource(
> > "256", "test", "persistentId", "/volume", None(), true);
> > 
> > Parameter shared;
> > shared.resources = Resources::parse("cpus:1;mem:128").get() + disk;
> > shared.totalOperations = 5;
> > ```
> 
> Anindya Sinha wrote:
> Both are equivalent, but I will change it so as to match the flow of 
> existing code in this function.
> 
> Jiang Yan Xu wrote:
> I don't think we need to do this. 
> 
> It's very clear as it is that `Parameter shared;` starts the section that 
> prepares the variable. The rest of the section fills in the variable's 
> members. The rest of the method is similar in this regard. The fact that 
> `disk` is defined separately is just for cosmetic reasons (we could have 
> inlined it but the indentation would look a bit awkward. 
> 
> This is different from the anti-pattern that defines the variable far 
> away from where it's first used (which results in poor readability).

Thanks Jiang Yan and Anindya. I think that as long as we have a comment here in 
L2480 and L2481, then it should be ok to move the `Parameter shared;` to the 
code where it first used (right before L2486). This can also make the style 
consistent with here 
https://github.com/apache/mesos/blob/master/src/tests/resources_tests.cpp#L2654-L2664


- Guangya


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


On 七月 30, 2016, 7:03 a.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50205/
> ---
> 
> (Updated 七月 30, 2016, 7:03 a.m.)
> 
> 
> Review request for mesos, Klaus Ma and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4892
> https://issues.apache.org/jira/browse/MESOS-4892
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced benchmark test for resources to include shared resources.
> 
> 
> Diffs
> -
> 
>   src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 
> 
> Diff: https://reviews.apache.org/r/50205/diff/
> 
> 
> Testing
> ---
> 
> Tests passed. Results for resources benchmark is as follows:
> 
> Minimal impact seen in Resources arithmetic with the Resources refactor 
> changes to incorporate shared resources.
> 
> With shared resources patch (note that 4th test below is for shared resources 
> for scalars)
> 
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (806 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17032 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1048 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (940 ms)
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (19826 
> ms total)
> 
> HEAD
> 
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (726 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17413 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1026 
> ms)
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test (19165 
> ms total)
> 
> Output from stdout is:
> 
> [==] Running 4 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> Took 72635us to perform 5 'total += r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 116027us to perform 5 'total -= r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 

Re: Review Request 50205: Enhanced benchmark test for resources to include shared resources.

2016-08-01 Thread Jiang Yan Xu


> On July 28, 2016, 6:43 p.m., Guangya Liu wrote:
> > src/tests/resources_tests.cpp, lines 2480-2487
> > 
> >
> > I prefer that you adjust the position of `shared` to the place where it 
> > was used.
> > 
> > ```
> > // Test a typical vector of scalars which include shared resources
> > // (viz, shared persistent volumes).
> > Resource disk = createDiskResource(
> > "256", "test", "persistentId", "/volume", None(), true);
> > 
> > Parameter shared;
> > shared.resources = Resources::parse("cpus:1;mem:128").get() + disk;
> > shared.totalOperations = 5;
> > ```
> 
> Anindya Sinha wrote:
> Both are equivalent, but I will change it so as to match the flow of 
> existing code in this function.

I don't think we need to do this. 

It's very clear as it is that `Parameter shared;` starts the section that 
prepares the variable. The rest of the section fills in the variable's members. 
The rest of the method is similar in this regard. The fact that `disk` is 
defined separately is just for cosmetic reasons (we could have inlined it but 
the indentation would look a bit awkward. 

This is different from the anti-pattern that defines the variable far away from 
where it's first used (which results in poor readability).


- Jiang Yan


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


On July 30, 2016, 12:03 a.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50205/
> ---
> 
> (Updated July 30, 2016, 12:03 a.m.)
> 
> 
> Review request for mesos, Klaus Ma and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4892
> https://issues.apache.org/jira/browse/MESOS-4892
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced benchmark test for resources to include shared resources.
> 
> 
> Diffs
> -
> 
>   src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 
> 
> Diff: https://reviews.apache.org/r/50205/diff/
> 
> 
> Testing
> ---
> 
> Tests passed. Results for resources benchmark is as follows:
> 
> Minimal impact seen in Resources arithmetic with the Resources refactor 
> changes to incorporate shared resources.
> 
> With shared resources patch (note that 4th test below is for shared resources 
> for scalars)
> 
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (806 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17032 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1048 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (940 ms)
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (19826 
> ms total)
> 
> HEAD
> 
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (726 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17413 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1026 
> ms)
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test (19165 
> ms total)
> 
> Output from stdout is:
> 
> [==] Running 4 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> Took 72635us to perform 5 'total += r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 116027us to perform 5 'total -= r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 283213us to perform 5 'total = total + r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 333641us to perform 5 'total = total - r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (806 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> Took 4.103766secs to 

Re: Review Request 50205: Enhanced benchmark test for resources to include shared resources.

2016-08-01 Thread Anindya Sinha


> On July 29, 2016, 1:43 a.m., Guangya Liu wrote:
> > src/tests/resources_tests.cpp, lines 2480-2487
> > 
> >
> > I prefer that you adjust the position of `shared` to the place where it 
> > was used.
> > 
> > ```
> > // Test a typical vector of scalars which include shared resources
> > // (viz, shared persistent volumes).
> > Resource disk = createDiskResource(
> > "256", "test", "persistentId", "/volume", None(), true);
> > 
> > Parameter shared;
> > shared.resources = Resources::parse("cpus:1;mem:128").get() + disk;
> > shared.totalOperations = 5;
> > ```

Both are equivalent, but I will change it so as to match the flow of existing 
code in this function.


- Anindya


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


On July 30, 2016, 7:03 a.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50205/
> ---
> 
> (Updated July 30, 2016, 7:03 a.m.)
> 
> 
> Review request for mesos, Klaus Ma and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4892
> https://issues.apache.org/jira/browse/MESOS-4892
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced benchmark test for resources to include shared resources.
> 
> 
> Diffs
> -
> 
>   src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 
> 
> Diff: https://reviews.apache.org/r/50205/diff/
> 
> 
> Testing
> ---
> 
> Tests passed. Results for resources benchmark is as follows:
> 
> Minimal impact seen in Resources arithmetic with the Resources refactor 
> changes to incorporate shared resources.
> 
> With shared resources patch (note that 4th test below is for shared resources 
> for scalars)
> 
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (806 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17032 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1048 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (940 ms)
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (19826 
> ms total)
> 
> HEAD
> 
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (726 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17413 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1026 
> ms)
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test (19165 
> ms total)
> 
> Output from stdout is:
> 
> [==] Running 4 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> Took 72635us to perform 5 'total += r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 116027us to perform 5 'total -= r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 283213us to perform 5 'total = total + r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 333641us to perform 5 'total = total - r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (806 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> Took 4.103766secs to perform 10 'total += r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> Took 4.310104secs to perform 10 'total -= r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> Took 4186ms to perform 10 'total = total + r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> Took 4.380353secs to perform 10 'total = total - r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17032 
> ms)
> [ RUN  ] 

Re: Review Request 50205: Enhanced benchmark test for resources to include shared resources.

2016-07-30 Thread Anindya Sinha

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

(Updated July 30, 2016, 7:03 a.m.)


Review request for mesos, Klaus Ma and Jiang Yan Xu.


Changes
---

Test results updated after rebase.


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


Repository: mesos


Description
---

Enhanced benchmark test for resources to include shared resources.


Diffs (updated)
-

  src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 

Diff: https://reviews.apache.org/r/50205/diff/


Testing (updated)
---

Tests passed. Results for resources benchmark is as follows:

Minimal impact seen in Resources arithmetic with the Resources refactor changes 
to incorporate shared resources.

With shared resources patch (note that 4th test below is for shared resources 
for scalars)

[--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (806 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17032 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1048 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (940 ms)
[--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (19826 ms 
total)

HEAD

[--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (726 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17413 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1026 ms)
[--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test (19165 ms 
total)

Output from stdout is:

[==] Running 4 tests from 1 test case.
[--] Global test environment set-up.
[--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
Took 72635us to perform 5 'total += r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 116027us to perform 5 'total -= r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 283213us to perform 5 'total = total + r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
Took 333641us to perform 5 'total = total - r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (806 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
Took 4.103766secs to perform 10 'total += r' operations on cpus(0, principal_0, 
{key_0: value_0}):1; gpus(...
Took 4.310104secs to perform 10 'total -= r' operations on cpus(0, principal_0, 
{key_0: value_0}):1; gpus(...
Took 4186ms to perform 10 'total = total + r' operations on cpus(0, 
principal_0, {key_0: value_0}):1; gpus(...
Took 4.380353secs to perform 10 'total = total - r' operations on cpus(0, 
principal_0, {key_0: value_0}):1; gpus(...
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17032 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
Took 483119us to perform 1000 'total += r' operations on ports(*):[1-2, 4-5, 
7-8, 10-11, 13-14, 16-17, 1...
Took 2271us to perform 1000 'total -= r' operations on ports(*):[1-2, 4-5, 7-8, 
10-11, 13-14, 16-17, 1...
Took 559844us to perform 1000 'total = total + r' operations on ports(*):[1-2, 
4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 2423us to perform 1000 'total = total - r' operations on ports(*):[1-2, 
4-5, 7-8, 10-11, 13-14, 16-17, 1...
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (1048 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
Took 61629us to perform 5 'total += r' operations on cpus(*):1; mem(*):128; 
disk(test)[persistentId:...
Took 98664us to perform 5 'total -= r' operations on cpus(*):1; mem(*):128; 
disk(test)[persistentId:...
Took 348041us to perform 5 'total = total + r' operations on cpus(*):1; 
mem(*):128; disk(test)[persistentId:...
Took 431057us to perform 5 'total = total - r' operations on cpus(*):1; 
mem(*):128; disk(test)[persistentId:...
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (940 ms)
[--] 4 tests from 

Re: Review Request 50205: Enhanced benchmark test for resources to include shared resources.

2016-07-29 Thread Anindya Sinha

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

(Updated July 29, 2016, 7:09 p.m.)


Review request for mesos, Klaus Ma and Jiang Yan Xu.


Changes
---

Rebased and addressed review comment.


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


Repository: mesos


Description
---

Enhanced benchmark test for resources to include shared resources.


Diffs (updated)
-

  src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 

Diff: https://reviews.apache.org/r/50205/diff/


Testing
---

Tests passed. Results for resources benchmark is as follows:

Minimal impact seen in Resources arithmetic with the Resources refactor changes 
to incorporate shared resources.

With shared resources patch (note that 4th test below is for shared resources 
for scalars)

[--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (964 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17099 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (9222 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (1049 ms)
[--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (28334 ms 
total)

HEAD

[--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (866 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17563 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (9218 ms)
[--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test (27647 ms 
total)

Output from stdout is:

[==] Running 4 tests from 1 test case.
[--] Global test environment set-up.
[--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
Took 113429us to perform 5 'total += r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 154104us to perform 5 'total -= r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 327479us to perform 5 'total = total + r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
Took 365752us to perform 5 'total = total - r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (964 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
Took 4.105799secs to perform 10 'total += r' operations on cpus(0, principal_0, 
{key_0: value_0}):1; gpus(...
Took 4.325702secs to perform 10 'total -= r' operations on cpus(0, principal_0, 
{key_0: value_0}):1; gpus(...
Took 4.188394secs to perform 10 'total = total + r' operations on cpus(0, 
principal_0, {key_0: value_0}):1; gpus(...
Took 4.428872secs to perform 10 'total = total - r' operations on cpus(0, 
principal_0, {key_0: value_0}):1; gpus(...
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17099 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
Took 2.515553secs to perform 1000 'total += r' operations on ports(*):[1-2, 
4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 2.038598secs to perform 1000 'total -= r' operations on ports(*):[1-2, 
4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 2.62789secs to perform 1000 'total = total + r' operations on 
ports(*):[1-2, 4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 2.03868secs to perform 1000 'total = total - r' operations on 
ports(*):[1-2, 4-5, 7-8, 10-11, 13-14, 16-17, 1...
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (9222 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
Took 102441us to perform 5 'total += r' operations on cpus(*):1; 
mem(*):128; disk(test)[persistentId:...
Took 141011us to perform 5 'total -= r' operations on cpus(*):1; 
mem(*):128; disk(test)[persistentId:...
Took 383887us to perform 5 'total = total + r' operations on cpus(*):1; 
mem(*):128; disk(test)[persistentId:...
Took 421132us to perform 5 'total = total - r' operations on cpus(*):1; 
mem(*):128; disk(test)[persistentId:...
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (1049 ms)
[--] 4 tests from 

Re: Review Request 50205: Enhanced benchmark test for resources to include shared resources.

2016-07-28 Thread Guangya Liu

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




src/tests/resources_tests.cpp (lines 2480 - 2487)


I prefer that you adjust the position of `shared` to the place where it was 
used.

```
// Test a typical vector of scalars which include shared resources
// (viz, shared persistent volumes).
Resource disk = createDiskResource(
"256", "test", "persistentId", "/volume", None(), true);

Parameter shared;
shared.resources = Resources::parse("cpus:1;mem:128").get() + disk;
shared.totalOperations = 5;
```


- Guangya Liu


On 七月 19, 2016, 10:52 p.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50205/
> ---
> 
> (Updated 七月 19, 2016, 10:52 p.m.)
> 
> 
> Review request for mesos, Klaus Ma and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4892
> https://issues.apache.org/jira/browse/MESOS-4892
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced benchmark test for resources to include shared resources.
> 
> 
> Diffs
> -
> 
>   src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 
> 
> Diff: https://reviews.apache.org/r/50205/diff/
> 
> 
> Testing
> ---
> 
> Tests passed. Results for resources benchmark is as follows:
> 
> Minimal impact seen in Resources arithmetic with the Resources refactor 
> changes to incorporate shared resources.
> 
> With shared resources patch (note that 4th test below is for shared resources 
> for scalars)
> 
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (964 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17099 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (9222 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (1049 
> ms)
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (28334 
> ms total)
> 
> HEAD
> 
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (866 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17563 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (9218 
> ms)
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test (27647 
> ms total)
> 
> Output from stdout is:
> 
> [==] Running 4 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> Took 113429us to perform 5 'total += r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 154104us to perform 5 'total -= r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 327479us to perform 5 'total = total + r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 365752us to perform 5 'total = total - r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (964 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> Took 4.105799secs to perform 10 'total += r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> Took 4.325702secs to perform 10 'total -= r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> Took 4.188394secs to perform 10 'total = total + r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> Took 4.428872secs to perform 10 'total = total - r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17099 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> Took 2.515553secs to perform 1000 'total += r' operations on ports(*):[1-2, 
> 4-5, 7-8, 10-11, 13-14, 16-17, 1...
> Took 2.038598secs to perform 1000 'total -= r' operations on 

Re: Review Request 50205: Enhanced benchmark test for resources to include shared resources.

2016-07-28 Thread Jiang Yan Xu

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


Ship it!




BTW the method `static vector parameters()` should probably 
eventually be splitted into individual clearly named methods when it gets even 
longer but it's fine for now I guess.

- Jiang Yan Xu


On July 19, 2016, 3:52 p.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50205/
> ---
> 
> (Updated July 19, 2016, 3:52 p.m.)
> 
> 
> Review request for mesos, Klaus Ma and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4892
> https://issues.apache.org/jira/browse/MESOS-4892
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Enhanced benchmark test for resources to include shared resources.
> 
> 
> Diffs
> -
> 
>   src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 
> 
> Diff: https://reviews.apache.org/r/50205/diff/
> 
> 
> Testing
> ---
> 
> Tests passed. Results for resources benchmark is as follows:
> 
> Minimal impact seen in Resources arithmetic with the Resources refactor 
> changes to incorporate shared resources.
> 
> With shared resources patch (note that 4th test below is for shared resources 
> for scalars)
> 
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (964 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17099 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (9222 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (1049 
> ms)
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (28334 
> ms total)
> 
> HEAD
> 
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (866 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17563 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (9218 
> ms)
> [--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test (27647 
> ms total)
> 
> Output from stdout is:
> 
> [==] Running 4 tests from 1 test case.
> [--] Global test environment set-up.
> [--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
> Took 113429us to perform 5 'total += r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 154104us to perform 5 'total -= r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 327479us to perform 5 'total = total + r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> Took 365752us to perform 5 'total = total - r' operations on cpus(*):1; 
> gpus(*):1; mem(*):128; disk(*):256
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (964 ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
> Took 4.105799secs to perform 10 'total += r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> Took 4.325702secs to perform 10 'total -= r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> Took 4.188394secs to perform 10 'total = total + r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> Took 4.428872secs to perform 10 'total = total - r' operations on cpus(0, 
> principal_0, {key_0: value_0}):1; gpus(...
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17099 
> ms)
> [ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
> Took 2.515553secs to perform 1000 'total += r' operations on ports(*):[1-2, 
> 4-5, 7-8, 10-11, 13-14, 16-17, 1...
> Took 2.038598secs to perform 1000 'total -= r' operations on ports(*):[1-2, 
> 4-5, 7-8, 10-11, 13-14, 16-17, 1...
> Took 2.62789secs to perform 1000 'total = total + r' operations on 
> ports(*):[1-2, 4-5, 7-8, 10-11, 13-14, 16-17, 1...
> Took 2.03868secs to perform 1000 'total = total - r' operations on 
> ports(*):[1-2, 4-5, 7-8, 10-11, 13-14, 16-17, 1...
> [   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (9222 
> 

Review Request 50205: Enhanced benchmark test for resources to include shared resources.

2016-07-19 Thread Anindya Sinha

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

Review request for mesos, Klaus Ma and Jiang Yan Xu.


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


Repository: mesos


Description
---

Enhanced benchmark test for resources to include shared resources.


Diffs
-

  src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 

Diff: https://reviews.apache.org/r/50205/diff/


Testing
---

Tests passed. Results for resources benchmark is as follows:

Minimal impact seen in Resources arithmetic with the Resources refactor changes 
to incorporate shared resources.

With shared resources patch (note that 4th test below is for shared resources 
for scalars)

[--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (964 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17099 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (9222 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (1049 ms)
[--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (28334 ms 
total)

HEAD

[--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (866 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17563 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (9218 ms)
[--] 3 tests from ResourcesOperators/Resources_BENCHMARK_Test (27647 ms 
total)

Output from stdout is:

[==] Running 4 tests from 1 test case.
[--] Global test environment set-up.
[--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0
Took 113429us to perform 5 'total += r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 154104us to perform 5 'total -= r' operations on cpus(*):1; gpus(*):1; 
mem(*):128; disk(*):256
Took 327479us to perform 5 'total = total + r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
Took 365752us to perform 5 'total = total - r' operations on cpus(*):1; 
gpus(*):1; mem(*):128; disk(*):256
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 (964 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1
Took 4.105799secs to perform 10 'total += r' operations on cpus(0, principal_0, 
{key_0: value_0}):1; gpus(...
Took 4.325702secs to perform 10 'total -= r' operations on cpus(0, principal_0, 
{key_0: value_0}):1; gpus(...
Took 4.188394secs to perform 10 'total = total + r' operations on cpus(0, 
principal_0, {key_0: value_0}):1; gpus(...
Took 4.428872secs to perform 10 'total = total - r' operations on cpus(0, 
principal_0, {key_0: value_0}):1; gpus(...
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/1 (17099 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
Took 2.515553secs to perform 1000 'total += r' operations on ports(*):[1-2, 
4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 2.038598secs to perform 1000 'total -= r' operations on ports(*):[1-2, 
4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 2.62789secs to perform 1000 'total = total + r' operations on 
ports(*):[1-2, 4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 2.03868secs to perform 1000 'total = total - r' operations on 
ports(*):[1-2, 4-5, 7-8, 10-11, 13-14, 16-17, 1...
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (9222 ms)
[ RUN  ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3
Took 102441us to perform 5 'total += r' operations on cpus(*):1; 
mem(*):128; disk(test)[persistentId:...
Took 141011us to perform 5 'total -= r' operations on cpus(*):1; 
mem(*):128; disk(test)[persistentId:...
Took 383887us to perform 5 'total = total + r' operations on cpus(*):1; 
mem(*):128; disk(test)[persistentId:...
Took 421132us to perform 5 'total = total - r' operations on cpus(*):1; 
mem(*):128; disk(test)[persistentId:...
[   OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/3 (1049 ms)
[--] 4 tests from ResourcesOperators/Resources_BENCHMARK_Test (28334 ms 
total)

[--] Global test environment tear-down
[==]