You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/11/16 18:15:54 UTC

[10/10] brooklyn-server git commit: Closes #423

Closes #423

BROOKLYN-382: get-catalog performance 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}
```


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/406c2952
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/406c2952
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/406c2952

Branch: refs/heads/master
Commit: 406c2952304cf217d21274446dc685eca35b88e3
Parents: 5b65fad 0288169
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Wed Nov 16 20:15:25 2016 +0200
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Wed Nov 16 20:15:25 2016 +0200

----------------------------------------------------------------------
 .../brooklyn/api/catalog/BrooklynCatalog.java   |  24 ++-
 .../catalog/SpecParameterUnwrappingTest.java    |  28 ++-
 .../qa/performance/CatalogPerformanceTest.java  | 172 +++++++++++++++++
 .../brooklyn/test/lite/CampYamlLiteTest.java    |   3 +-
 .../core/catalog/CatalogPredicates.java         |  36 ++++
 .../catalog/internal/BasicBrooklynCatalog.java  |  89 ++++++++-
 .../core/catalog/internal/CatalogScanTest.java  |   3 +-
 .../internal/EntityExecutionManagerTest.java    | 113 ++++-------
 .../qa/performance/AbstractPerformanceTest.java |   4 +-
 .../EntityPerformanceLongevityTest.java         |  35 ----
 .../qa/performance/EntityPerformanceTest.java   |   3 +
 .../GroovyYardStickPerformanceTest.groovy       |   2 +-
 .../qa/performance/TaskPerformanceTest.java     |   1 -
 .../ssh/cli/SshCliToolPerformanceTest.java      |   7 -
 .../rest/domain/CatalogEntitySummary.java       |   7 +-
 .../rest/resources/CatalogResource.java         |   6 +-
 .../rest/transform/CatalogTransformer.java      |   4 +-
 .../BrooklynRestResourcePerformanceTest.java    |  37 ++++
 .../CatalogResourcePerformanceTest.java         | 185 +++++++++++++++++++
 .../rest/testing/BrooklynRestResourceTest.java  |   4 +-
 .../main/java/org/apache/brooklyn/cli/Main.java |   4 +-
 .../brooklyn/cli/lister/ItemDescriptors.java    |   5 +-
 .../test/performance/PerformanceMeasurer.java   |  15 ++
 .../performance/PerformanceTestDescriptor.java  |  18 ++
 24 files changed, 643 insertions(+), 162 deletions(-)
----------------------------------------------------------------------