static def LARGE_SCHEMA_SET = 'largeSchemaSet'
static def PERFORMANCE_RECORD = []
- def stopWatch = new StopWatch()
-
def cleanupSpec() {
- println('#############################################################################')
+ println('##################################################################################################')
printTitle()
- println('#############################################################################')
+ println('##################################################################################################')
PERFORMANCE_RECORD.sort().each {
println(it)
}
- println('#############################################################################')
+ println('##################################################################################################')
PERFORMANCE_RECORD.clear()
}
abstract def createInitialData()
- def recordAndAssertPerformance(String shortTitle, thresholdInMs, recordedTimeInMs) {
- def pass = recordedTimeInMs <= thresholdInMs
+ def recordAndAssertResourceUsage(String shortTitle, double thresholdInSec, double recordedTimeInSec, memoryLimit, memoryUsageInMB) {
+ def pass = recordedTimeInSec <= thresholdInSec && memoryUsageInMB <= memoryLimit
if (shortTitle.length() > 40) {
shortTitle = shortTitle.substring(0, 40)
}
- def record = String.format('%2d.%-40s limit%,7d took %,7d ms ', PERFORMANCE_RECORD.size() + 1, shortTitle, thresholdInMs, recordedTimeInMs)
+ def record = String.format('%2d.%-40s limit %8.2f took %8.2f sec %,8.2f MB used ', PERFORMANCE_RECORD.size() + 1, shortTitle, thresholdInSec, recordedTimeInSec, memoryUsageInMB)
record += pass ? 'PASS' : 'FAIL'
PERFORMANCE_RECORD.add(record)
- assert recordedTimeInMs <= thresholdInMs
+ assert recordedTimeInSec <= thresholdInSec
+ assert memoryUsageInMB <= memoryLimit
return true
}
}