GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/423

    Performance catalog improvements

    The `specCache` speeds up the REST api calls to `/catalog/entities` 
considerably.
    
    For example, with 10 small yaml entities in the catalog, before the cache 
it takes about 170ms per call (and proportionately more as we increase the 
number of catalog items or their size):
    
    ```
    
test=PerformanceTestDescriptor{summary=CatalogResourcePerformanceTest.testListAllEntities,
 iterations=100, warmupIterations=10, 
job=org.apache.brooklyn.rest.resources.CatalogResourcePerformanceTest$8@246f150f,
 minAcceptablePerSecond=1.0}; result=PerformanceTestResult{duration=16s 981ms, 
warmup=3s 274ms, iterations=100, warmupIterations=10, 
ratePerSecond=5.888934691714269, histogram={134.2ms-268.4ms: 100}, 
cpuTotalFraction=1.3575868461219567, cpuSampleFractions=[1.2573016983016982, 
1.9225778443113772, 1.4971834496510468, 1.5281373134328358, 1.1606623505976095, 
1.2851962151394423, 1.2523649052841475, 1.2795744255744255, 1.211623880597015, 
1.1832784431137724, 1.162554, 1.3302412761714855, 1.1046873126873127, 
1.4044291417165669, 1.0696699900299103, 1.846793, 1.0917181274900398], 
minAcceptablePerSecond=1.0}
    ```
    
    With the cache, it takes 24ms per call:
    ```
    
test=PerformanceTestDescriptor{summary=CatalogResourcePerformanceTest.testListAllEntities,
 iterations=100, warmupIterations=10, 
job=org.apache.brooklyn.rest.resources.CatalogResourcePerformanceTest$8@345a656a,
 minAcceptablePerSecond=1.0}; result=PerformanceTestResult{duration=2s 417ms, 
warmup=1s 393ms, iterations=100, warmupIterations=10, 
ratePerSecond=41.373603640877114, histogram={8.389ms-16.78ms: 20, 
16.78ms-33.55ms: 74, 33.55ms-67.11ms: 4, 67.11ms-134.2ms: 1, 134.2ms-268.4ms: 
1}, cpuTotalFraction=2.552031110340871, cpuSampleFractions=[2.367437, 
1.722136], minAcceptablePerSecond=1.0}
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/brooklyn-server 
performance-catalog-improvements

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/423.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #423
    
----
commit 08f78f38a469230973b63ea32d420ddf61b6fc34
Author: Aled Sage <[email protected]>
Date:   2016-11-09T16:02:14Z

    Add CatalogPredicates toString methods

commit 0686d5b65eb08879027a658e3492a57cc9500198
Author: Aled Sage <[email protected]>
Date:   2016-11-09T16:03:26Z

    Improve CatalogEntitySummary.toString

commit 022b2a1addd1cd74033b758e23aab26a5ba6135d
Author: Aled Sage <[email protected]>
Date:   2016-11-09T16:09:24Z

    Add “Performance” testng profile
    
    Use this instead of just integration/acceptance for performance tests.

commit d8495ed2eaa2382db60966f47fbe2b7b9fcd5e78
Author: Aled Sage <[email protected]>
Date:   2016-11-09T16:09:59Z

    Add pre/post-job to PerformanceMeasurer

commit 4e7192c59edf8eaa4d17ddce5bceaeeb53372740
Author: Aled Sage <[email protected]>
Date:   2016-11-09T16:18:04Z

    Add catalog performance tests

commit 03c2d2068be7cc3a8c4f42fd07800bbccedffb61
Author: Aled Sage <[email protected]>
Date:   2016-11-09T16:18:12Z

    CatalogResource: minor tidy

commit 527d5049adba4f020b334c8d85e7c9be5f8e0688
Author: Aled Sage <[email protected]>
Date:   2016-11-09T16:19:11Z

    Add BasicBrooklynCatalog.specCache
    
    Cache the Specs we generate (by parsing the yaml), rather than
    re-parsing the YAML every time createSpec(item) is called.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to