aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2025-03-07 16:57:52 +0000
committerdanielhanrahan <daniel.hanrahan@est.tech>2025-03-11 09:26:51 +0000
commit68cbf13cbac30e549757ae3a0a1977ba2ad1cd62 (patch)
tree4ed9d00ec209b79a3b4f641a01b66393728a3e43
parent025b21992b7b88d03f630beb8299bf2be28286a9 (diff)
Groovy performance test for attribute-axis
This adds a groovy performance for attribute-axis feature (queryDataLeaf API). Issue-ID: CPS-2635 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ib7fe324897a3a829cac3ced3446b4d007dc2bee4
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy28
1 files changed, 23 insertions, 5 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy
index acc95cab8d..53e39ed9c0 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/QueryPerfTest.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2023 Nordix Foundation
+ * Copyright (C) 2023-2025 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ class QueryPerfTest extends CpsPerfTestBase {
def durationInSeconds = resourceMeter.getTotalTimeInSeconds()
then: 'the expected number of nodes is returned'
assert countDataNodesInTree(result) == expectedNumberOfDataNodes
- and: 'all data is read within #durationLimit ms and memory used is within limit'
+ and: 'all data is read within #durationLimit seconds and memory used is within limit'
recordAndAssertResourceUsage("Query 1 anchor ${scenario}", durationLimit, durationInSeconds, memoryLimit, resourceMeter.getTotalMemoryUsageInMB())
where: 'the following parameters are used'
scenario | cpsPath || durationLimit | memoryLimit | expectedNumberOfDataNodes
@@ -60,7 +60,7 @@ class QueryPerfTest extends CpsPerfTestBase {
def durationInSeconds = resourceMeter.getTotalTimeInSeconds()
then: 'the expected number of nodes is returned'
assert countDataNodesInTree(result) == expectedNumberOfDataNodes
- and: 'all data is read within #durationLimit ms and memory used is within limit'
+ and: 'all data is read within #durationLimit seconds and memory used is within limit'
recordAndAssertResourceUsage("Query across anchors ${scenario}", durationLimit, durationInSeconds, memoryLimit, resourceMeter.getTotalMemoryUsageInMB())
where: 'the following parameters are used'
scenario | cpspath || durationLimit | memoryLimit | expectedNumberOfDataNodes
@@ -78,7 +78,7 @@ class QueryPerfTest extends CpsPerfTestBase {
def durationInSeconds = resourceMeter.getTotalTimeInSeconds()
then: 'the expected number of nodes is returned'
assert countDataNodesInTree(result) == expectedNumberOfDataNodes
- and: 'all data is read within #durationLimit ms and memory used is within limit'
+ and: 'all data is read within #durationLimit seconds and memory used is within limit'
recordAndAssertResourceUsage("Query with ${scenario}", durationLimit, durationInSeconds, memoryLimit, resourceMeter.getTotalMemoryUsageInMB())
where: 'the following parameters are used'
scenario | fetchDescendantsOption || durationLimit | memoryLimit | expectedNumberOfDataNodes
@@ -95,7 +95,7 @@ class QueryPerfTest extends CpsPerfTestBase {
def durationInSeconds = resourceMeter.getTotalTimeInSeconds()
then: 'the expected number of nodes is returned'
assert countDataNodesInTree(result) == expectedNumberOfDataNodes
- and: 'all data is read within #durationLimit ms and memory used is within limit'
+ and: 'all data is read within #durationLimit seconds and memory used is within limit'
recordAndAssertResourceUsage("Query ancestors with ${scenario}", durationLimit, durationInSeconds, memoryLimit, resourceMeter.getTotalMemoryUsageInMB())
where: 'the following parameters are used'
scenario | fetchDescendantsOption || durationLimit | memoryLimit | expectedNumberOfDataNodes
@@ -103,4 +103,22 @@ class QueryPerfTest extends CpsPerfTestBase {
'direct descendants' | DIRECT_CHILDREN_ONLY || 0.11 | 8 | 1 + OPENROADM_DEVICES_PER_ANCHOR
'all descendants' | INCLUDE_ALL_DESCENDANTS || 1.34 | 400 | 1 + OPENROADM_DEVICES_PER_ANCHOR * OPENROADM_DATANODES_PER_DEVICE
}
+
+ def 'Query data leaf with #scenario.'() {
+ when: 'query data leaf is called'
+ resourceMeter.start()
+ def result = objectUnderTest.queryDataLeaf(CPS_PERFORMANCE_TEST_DATASPACE, 'openroadm1', cpsPath, String)
+ resourceMeter.stop()
+ def durationInSeconds = resourceMeter.getTotalTimeInSeconds()
+ then: 'the expected number of results is returned'
+ assert result.size() == expectedNumberOfValues
+ and: 'all data is read within #durationLimit seconds and memory used is within limit'
+ recordAndAssertResourceUsage("Query data leaf ${scenario}", durationLimit, durationInSeconds, memoryLimit, resourceMeter.getTotalMemoryUsageInMB())
+ where: 'the following parameters are used'
+ scenario | cpsPath || durationLimit | memoryLimit | expectedNumberOfValues
+ 'unique leaf value' | '/openroadm-devices/openroadm-device/@device-id' || 0.10 | 8 | OPENROADM_DEVICES_PER_ANCHOR
+ 'common leaf value' | '/openroadm-devices/openroadm-device/@ne-state' || 0.05 | 1 | 1
+ 'non-existing data leaf' | '/openroadm-devices/openroadm-device/@non-existing' || 0.05 | 1 | 0
+ }
+
}