Skip to content

Commit

Permalink
Merge "[k6] CM handles searches using different filters"
Browse files Browse the repository at this point in the history
  • Loading branch information
mpriyank91 authored and Gerrit Code Review committed Sep 25, 2024
2 parents 2bcccff + a9de166 commit 2dbf148
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 30 deletions.
2 changes: 1 addition & 1 deletion k6-tests/ncmp/common/cmhandle-crud.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function createCmHandlePayload(cmHandleIds) {
}

function getNumberOfReadyCmHandles() {
const response = executeCmHandleIdSearch('readyCmHandles');
const response = executeCmHandleIdSearch('cps-path-for-ready-cm-handles');
const arrayOfCmHandleIds = JSON.parse(response.body);
return arrayOfCmHandleIds.length;
}
21 changes: 18 additions & 3 deletions k6-tests/ncmp/common/search-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,34 @@ function executeSearchRequest(searchType, scenario) {
}

const SEARCH_PARAMETERS_PER_SCENARIO = {
"module-and-properties": {
"no-filter": {
"cmHandleQueryParameters": []
},
"module": {
"cmHandleQueryParameters": [
{
"conditionName": "hasAllModules",
"conditionParameters": [{"moduleName": "ietf-yang-types"}]
},
}
]
},
"property": {
"cmHandleQueryParameters": [
{
"conditionName": "hasAllProperties",
"conditionParameters": [{"Color": "yellow"}]
}
]
},
"readyCmHandles": {
"trust-level": {
"cmHandleQueryParameters": [
{
"conditionName": "cmHandleWithTrustLevel",
"conditionParameters": [ {"trustLevel": "COMPLETE"} ]
}
]
},
"cps-path-for-ready-cm-handles": {
"cmHandleQueryParameters": [
{
"conditionName": "cmHandleWithCpsPath",
Expand Down
12 changes: 10 additions & 2 deletions k6-tests/ncmp/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,16 @@ export function makeCustomSummaryReport(testResults, scenarioConfig) {
makeSummaryCsvLine('0', 'HTTP request failures for all tests', 'rate of failed requests', 'http_req_failed', 0, testResults, scenarioConfig),
makeSummaryCsvLine('1', 'Registration of CM-handles', 'CM-handles/second', 'cmhandles_created_per_second', 110, testResults, scenarioConfig),
makeSummaryCsvLine('2', 'De-registration of CM-handles', 'CM-handles/second', 'cmhandles_deleted_per_second', 80, testResults, scenarioConfig),
makeSummaryCsvLine('3', 'CM-handle ID search with Module and Property filter', 'milliseconds', 'id_search_duration', 4000, testResults, scenarioConfig),
makeSummaryCsvLine('4', 'CM-handle search with Module and Property filter', 'milliseconds', 'cm_search_duration', 30000, testResults, scenarioConfig),
makeSummaryCsvLine('3a', 'CM-handle ID search with No filter', 'milliseconds', 'id_search_nofilter_duration', 4000, testResults, scenarioConfig),
makeSummaryCsvLine('3b', 'CM-handle ID search with Module filter', 'milliseconds', 'id_search_module_duration', 4000, testResults, scenarioConfig),
makeSummaryCsvLine('3c', 'CM-handle ID search with Property filter', 'milliseconds', 'id_search_property_duration', 4000, testResults, scenarioConfig),
makeSummaryCsvLine('3d', 'CM-handle ID search with Cps Path filter', 'milliseconds', 'id_search_cpspath_duration', 4000, testResults, scenarioConfig),
makeSummaryCsvLine('3e', 'CM-handle ID search with Trust Level filter', 'milliseconds', 'id_search_trustlevel_duration', 4000, testResults, scenarioConfig),
makeSummaryCsvLine('4a', 'CM-handle search with No filter', 'milliseconds', 'cm_search_nofilter_duration', 30000, testResults, scenarioConfig),
makeSummaryCsvLine('4b', 'CM-handle search with Module filter', 'milliseconds', 'cm_search_module_duration', 30000, testResults, scenarioConfig),
makeSummaryCsvLine('4c', 'CM-handle search with Property filter', 'milliseconds', 'cm_search_property_duration', 30000, testResults, scenarioConfig),
makeSummaryCsvLine('4d', 'CM-handle search with Cps Path filter', 'milliseconds', 'cm_search_cpspath_duration', 30000, testResults, scenarioConfig),
makeSummaryCsvLine('4e', 'CM-handle search with Trust Level filter', 'milliseconds', 'cm_search_trustlevel_duration', 30000, testResults, scenarioConfig),
makeSummaryCsvLine('5a', 'NCMP overhead for Synchronous single CM-handle pass-through read', 'milliseconds', 'ncmp_overhead_passthrough_read', 40, testResults, scenarioConfig),
makeSummaryCsvLine('5b', 'NCMP overhead for Synchronous single CM-handle pass-through read with alternate id', 'milliseconds', 'ncmp_overhead_passthrough_read_alt_id', 60, testResults, scenarioConfig),
makeSummaryCsvLine('6a', 'NCMP overhead for Synchronous single CM-handle pass-through write', 'milliseconds', 'ncmp_overhead_passthrough_write', 30, testResults, scenarioConfig),
Expand Down
176 changes: 152 additions & 24 deletions k6-tests/ncmp/ncmp-kpi.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@ let passthroughReadNcmpOverheadTrend = new Trend('ncmp_overhead_passthrough_read
let passthroughReadNcmpOverheadTrendWithAlternateId = new Trend('ncmp_overhead_passthrough_read_alt_id', true);
let passthroughWriteNcmpOverheadTrend = new Trend('ncmp_overhead_passthrough_write', true);
let passthroughWriteNcmpOverheadTrendWithAlternateId = new Trend('ncmp_overhead_passthrough_write_alt_id', true);
let idSearchDurationTrend = new Trend('id_search_duration', true);
let cmSearchDurationTrend = new Trend('cm_search_duration', true);
let idSearchNoFilterDurationTrend = new Trend('id_search_nofilter_duration', true);
let idSearchModuleDurationTrend = new Trend('id_search_module_duration', true);
let idSearchPropertyDurationTrend = new Trend('id_search_property_duration', true);
let idSearchCpsPathDurationTrend = new Trend('id_search_cpspath_duration', true);
let idSearchTrustLevelDurationTrend = new Trend('id_search_trustlevel_duration', true);
let cmSearchNoFilterDurationTrend = new Trend('cm_search_nofilter_duration', true);
let cmSearchModuleDurationTrend = new Trend('cm_search_module_duration', true);
let cmSearchPropertyDurationTrend = new Trend('cm_search_property_duration', true);
let cmSearchCpsPathDurationTrend = new Trend('cm_search_cpspath_duration', true);
let cmSearchTrustLevelDurationTrend = new Trend('cm_search_trustlevel_duration', true);
let legacyBatchReadCmHandlesPerSecondTrend = new Trend('legacy_batch_read_cmhandles_per_second', false);

const legacyBatchEventReader = new Reader({
Expand All @@ -56,37 +64,85 @@ export const options = {
passthrough_read_scenario: {
executor: 'constant-vus',
exec: 'passthroughReadScenario',
vus: 4,
vus: 2,
duration: DURATION,
},
passthrough_read_alt_id_scenario: {
executor: 'constant-vus',
exec: 'passthroughReadAltIdScenario',
vus: 4,
vus: 2,
duration: DURATION,
},
passthrough_write_scenario: {
executor: 'constant-vus',
exec: 'passthroughWriteScenario',
vus: 4,
vus: 2,
duration: DURATION,
},
passthrough_write_alt_id_scenario: {
executor: 'constant-vus',
exec: 'passthroughWriteAltIdScenario',
vus: 4,
vus: 2,
duration: DURATION,
},
cm_handle_id_search_nofilter_scenario: {
executor: 'constant-vus',
exec: 'cmHandleIdSearchNoFilterScenario',
vus: 1,
duration: DURATION,
},
cm_handle_search_nofilter_scenario: {
executor: 'constant-vus',
exec: 'cmHandleSearchNoFilterScenario',
vus: 1,
duration: DURATION,
},
cm_handle_id_search_module_scenario: {
executor: 'constant-vus',
exec: 'cmHandleIdSearchModuleScenario',
vus: 1,
duration: DURATION,
},
cm_handle_search_module_scenario: {
executor: 'constant-vus',
exec: 'cmHandleSearchModuleScenario',
vus: 1,
duration: DURATION,
},
cm_handle_id_search_property_scenario: {
executor: 'constant-vus',
exec: 'cmHandleIdSearchPropertyScenario',
vus: 1,
duration: DURATION,
},
cm_handle_search_property_scenario: {
executor: 'constant-vus',
exec: 'cmHandleSearchPropertyScenario',
vus: 1,
duration: DURATION,
},
cm_handle_id_search_cpspath_scenario: {
executor: 'constant-vus',
exec: 'cmHandleIdSearchCpsPathScenario',
vus: 1,
duration: DURATION,
},
cm_handle_search_cpspath_scenario: {
executor: 'constant-vus',
exec: 'cmHandleSearchCpsPathScenario',
vus: 1,
duration: DURATION,
},
cm_handle_id_search_scenario: {
cm_handle_id_search_trustlevel_scenario: {
executor: 'constant-vus',
exec: 'cmHandleIdSearchScenario',
vus: 5,
exec: 'cmHandleIdSearchTrustLevelScenario',
vus: 1,
duration: DURATION,
},
cm_handle_search_scenario: {
cm_handle_search_trustlevel_scenario: {
executor: 'constant-vus',
exec: 'cmHandleSearchScenario',
vus: 5,
exec: 'cmHandleSearchTrustLevelScenario',
vus: 1,
duration: DURATION,
},
legacy_batch_produce_scenario: {
Expand All @@ -112,8 +168,16 @@ export const options = {
'ncmp_overhead_passthrough_write': ['avg <= 40'],
'ncmp_overhead_passthrough_read_alt_id': ['avg <= 40'],
'ncmp_overhead_passthrough_write_alt_id': ['avg <= 40'],
'id_search_duration': ['avg <= 2000'],
'cm_search_duration': ['avg <= 15000'],
'id_search_nofilter_duration': ['avg <= 2000'],
'id_search_module_duration': ['avg <= 2000'],
'id_search_property_duration': ['avg <= 2000'],
'id_search_cpspath_duration': ['avg <= 2000'],
'id_search_trustlevel_duration': ['avg <= 2000'],
'cm_search_nofilter_duration': ['avg <= 15000'],
'cm_search_module_duration': ['avg <= 15000'],
'cm_search_property_duration': ['avg <= 15000'],
'cm_search_cpspath_duration': ['avg <= 15000'],
'cm_search_trustlevel_duration': ['avg <= 15000'],
'legacy_batch_read_cmhandles_per_second': ['avg >= 150'],
},
};
Expand Down Expand Up @@ -188,19 +252,83 @@ export function passthroughWriteAltIdScenario() {
}
}

export function cmHandleIdSearchScenario() {
const response = executeCmHandleIdSearch('module-and-properties');
if (check(response, { 'CM handle ID search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle ID search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
idSearchDurationTrend.add(response.timings.duration);
export function cmHandleIdSearchNoFilterScenario() {
const response = executeCmHandleIdSearch('no-filter');
if (check(response, { 'CM handle ID no-filter search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle ID no-filter search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
idSearchNoFilterDurationTrend.add(response.timings.duration);
}
}

export function cmHandleSearchNoFilterScenario() {
const response = executeCmHandleSearch('no-filter');
if (check(response, { 'CM handle no-filter search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle no-filter search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
cmSearchNoFilterDurationTrend.add(response.timings.duration);
}
}

export function cmHandleIdSearchModuleScenario() {
const response = executeCmHandleIdSearch('module');
if (check(response, { 'CM handle ID module search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle ID module search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
idSearchModuleDurationTrend.add(response.timings.duration);
}
}

export function cmHandleSearchModuleScenario() {
const response = executeCmHandleSearch('module');
if (check(response, { 'CM handle module search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle module search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
cmSearchModuleDurationTrend.add(response.timings.duration);
}
}

export function cmHandleIdSearchPropertyScenario() {
const response = executeCmHandleIdSearch('property');
if (check(response, { 'CM handle ID property search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle ID property search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
idSearchPropertyDurationTrend.add(response.timings.duration);
}
}

export function cmHandleSearchPropertyScenario() {
const response = executeCmHandleSearch('property');
if (check(response, { 'CM handle property search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle property search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
cmSearchPropertyDurationTrend.add(response.timings.duration);
}
}

export function cmHandleIdSearchCpsPathScenario() {
const response = executeCmHandleIdSearch('cps-path-for-ready-cm-handles');
if (check(response, { 'CM handle ID cps path search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle ID cps path search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
idSearchCpsPathDurationTrend.add(response.timings.duration);
}
}

export function cmHandleSearchCpsPathScenario() {
const response = executeCmHandleSearch('cps-path-for-ready-cm-handles');
if (check(response, { 'CM handle cps path search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle cps path search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
cmSearchCpsPathDurationTrend.add(response.timings.duration);
}
}

export function cmHandleIdSearchTrustLevelScenario() {
const response = executeCmHandleIdSearch('trust-level');
if (check(response, { 'CM handle ID trust level search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle ID trust level search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
idSearchTrustLevelDurationTrend.add(response.timings.duration);
}
}

export function cmHandleSearchScenario() {
const response = executeCmHandleSearch('module-and-properties');
if (check(response, { 'CM handle search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
cmSearchDurationTrend.add(response.timings.duration);
export function cmHandleSearchTrustLevelScenario() {
const response = executeCmHandleSearch('trust-level');
if (check(response, { 'CM handle trust level search status equals 200': (r) => r.status === 200 })
&& check(response, { 'CM handle trust level search returned expected CM-handles': (r) => r.json('#') === TOTAL_CM_HANDLES })) {
cmSearchTrustLevelDurationTrend.add(response.timings.duration);
}
}

Expand Down

0 comments on commit 2dbf148

Please sign in to comment.