/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2024 Nordix Foundation
+ * Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.cps.integration.performance.cps
import org.onap.cps.integration.performance.base.CpsPerfTestBase
-import org.onap.cps.spi.model.ModuleReference
+import org.onap.cps.api.model.ModuleReference
class ModuleQueryPerfTest extends CpsPerfTestBase {
}
resourceMeter.stop()
then: 'operation takes less than expected duration'
- recordAndAssertResourceUsage('Module query test setup',
- 45, resourceMeter.totalTimeInSeconds,
- 500, resourceMeter.totalMemoryUsageInMB
- )
+ recordAndAssertResourceUsage('CPS:Module query test setup', 150, resourceMeter.totalTimeInSeconds, resourceMeter.totalMemoryUsageInMB)
}
def 'Querying anchors by module name is NOT dependant on the file size of the module.'() {
then: 'expected number of anchors is returned'
assert result.size() == TOTAL_TEST_ANCHORS
and: 'operation completes with expected resource usage'
- recordAndAssertResourceUsage("Query for anchors with ${scenario}",
- expectedTimeInSeconds, resourceMeter.totalTimeInSeconds,
- 150, resourceMeter.totalMemoryUsageInMB)
+ recordAndAssertResourceUsage("CPS:Query for anchors with ${scenario}", 0.1, resourceMeter.totalTimeInSeconds, resourceMeter.totalMemoryUsageInMB, REFERENCE_GRAPH)
where: 'the following parameters are used'
- scenario | yangModuleName || expectedTimeInSeconds
- '1 KB module' | 'module0' || 3
- '1000 KB module' | 'module1' || 3
+ scenario | yangModuleName
+ '1 KB module' | 'module0'
+ '1000 KB module' | 'module1'
}
def 'Module query - Clean up test data.'() {
cpsModuleService.deleteSchemaSetsWithCascade(CPS_PERFORMANCE_TEST_DATASPACE, (i..i+100).collect {SCHEMA_SET_PREFIX + it})
}
cpsModuleService.deleteSchemaSetsWithCascade(CPS_PERFORMANCE_TEST_DATASPACE, [SCHEMA_SET_PREFIX + '0'])
+ cpsModuleService.deleteAllUnusedYangModuleData(CPS_PERFORMANCE_TEST_DATASPACE)
}
// This makes a Yang module of approximately target length in bytes by padding the description field with many '*'