Skip to content

Commit

Permalink
simplify urls in metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
clauyan committed Nov 25, 2024
1 parent 97985fd commit 65b233e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions loadtest/util/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ export function makeHttpRequest(
query: Array<string>;
body: RequestBody;
params: RefinedParams<ResponseType | undefined>;
url: ReturnType<typeof url>;
}>,
) {
const queryString = options?.query ? makeQueryString(options.query) : "";
const url = `${backendUrl}${resource}${queryString}`;
const url = options?.url
? options.url
: `${backendUrl}${resource}${queryString}`;
const response = request(verb.toUpperCase(), url, options?.body, {
...options?.params,
timeout: "70s",
Expand Down Expand Up @@ -223,7 +226,9 @@ export function getPersonInfo(query?: Array<string>) {
}

export function deletePersonById(id: string) {
const response = makeHttpRequest("delete", `personen/${id}`);
const response = makeHttpRequest("delete", `personen/${id}`, {
url: url`${backendUrl}personen/${id}`,
});
check(response, {
"got expected status": getStatusChecker(204),
...defaultTimingCheck,
Expand Down

0 comments on commit 65b233e

Please sign in to comment.