Skip to content

Commit

Permalink
Make more relevant check outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikevespi committed Jan 2, 2025
1 parent 684b378 commit def1ebc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion performance/backend_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ export const options = {
// mapSearchAllOpenComplaints: defaultOptions,
// mapSearchAllComplaints: defaultOptions,
// mapSearchWithCMFilter: defaultOptions,

// Complaint Details
getComplaintDetails: defaultOptions,
// addAndRemoveComplaintOutcome: defaultOptions,
addAndRemoveComplaintOutcome: defaultOptions,
},
thresholds: {
http_req_duration: ["p(99)<2000"], // 99% of requests must complete below 2s
Expand Down
18 changes: 9 additions & 9 deletions performance/tests/backend/search.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import http from "k6/http";
import { check } from "k6";

// Search for open HWCR complaints in the South Peace region
// Search with default parameters (open HWCR complaints in the South Peace region)
export const searchWithDefaultFilters = async (host, requestConfig) => {
check(
await http.get(
Expand All @@ -10,8 +10,8 @@ export const searchWithDefaultFilters = async (host, requestConfig) => {
requestConfig,
),
{
"response status 200": (r) => r.status === 200,
"response has entries": (r) => JSON.parse(r.body).totalCount > 0,
"Search with default parameters response status 200": (r) => r.status === 200,
"Search with default parameters response has entries": (r) => JSON.parse(r.body).totalCount > 0,
},
);
};
Expand All @@ -24,8 +24,8 @@ export const searchWithoutFilters = async (host, requestConfig) => {
requestConfig,
),
{
"response status 200": (r) => r.status === 200,
"response has entries": (r) => JSON.parse(r.body).totalCount > 0,
"Search for all HWCR complaints response status 200": (r) => r.status === 200,
"Search for all HWCR complaints response has entries": (r) => JSON.parse(r.body).totalCount > 0,
},
);
};
Expand All @@ -39,8 +39,8 @@ export const openSearchWithoutFilters = async (host, requestConfig) => {
requestConfig,
),
{
"response status 200": (r) => r.status === 200,
"response has entries": (r) => JSON.parse(r.body).totalCount > 0,
"Search for all open HWCR complaints response status 200": (r) => r.status === 200,
"Search for all open HWCR complaints response has entries": (r) => JSON.parse(r.body).totalCount > 0,
},
);
};
Expand All @@ -55,8 +55,8 @@ export const searchWithCMFilter = async (host, requestConfig) => {
requestConfig,
),
{
"response status 200": (r) => r.status === 200,
"response has entries": (r) => JSON.parse(r.body).totalCount > 0,
"Search with case management filters response status 200": (r) => r.status === 200,
"Search with case management filters response has entries": (r) => JSON.parse(r.body).totalCount > 0,
},
);
};

0 comments on commit def1ebc

Please sign in to comment.