aboutsummaryrefslogtreecommitdiffstats
path: root/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy')
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy7
1 files changed, 3 insertions, 4 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy
index b6ceb91b5..8e5fe0619 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/PerfTestBase.groovy
@@ -28,8 +28,6 @@ abstract class PerfTestBase extends CpsIntegrationSpecBase {
static def LARGE_SCHEMA_SET = 'largeSchemaSet'
static def PERFORMANCE_RECORD = []
- def stopWatch = new StopWatch()
-
def cleanupSpec() {
println('#############################################################################')
printTitle()
@@ -56,15 +54,16 @@ abstract class PerfTestBase extends CpsIntegrationSpecBase {
abstract def createInitialData()
- def recordAndAssertPerformance(String shortTitle, thresholdInMs, recordedTimeInMs) {
+ def recordAndAssertResourceUsage(String shortTitle, thresholdInMs, recordedTimeInMs, memoryLimit, memoryUsageInMB) {
def pass = recordedTimeInMs <= thresholdInMs
if (shortTitle.length() > 40) {
shortTitle = shortTitle.substring(0, 40)
}
- def record = String.format('%2d.%-40s limit%,8d took %,8d ms ', PERFORMANCE_RECORD.size() + 1, shortTitle, thresholdInMs, recordedTimeInMs)
+ def record = String.format('%2d.%-40s limit%,8d took %,8d ms %,8.2f MB used ', PERFORMANCE_RECORD.size() + 1, shortTitle, thresholdInMs, recordedTimeInMs, memoryUsageInMB)
record += pass ? 'PASS' : 'FAIL'
PERFORMANCE_RECORD.add(record)
assert recordedTimeInMs <= thresholdInMs
+ assert memoryUsageInMB <= memoryLimit
return true
}
}