generated from VilledeMontreal/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Matthieu <[email protected]> feat: add missing license Signed-off-by: Matthieu <[email protected]> feat: increase performance test to 2 hours Signed-off-by: Matthieu <[email protected]>
- Loading branch information
Showing
8 changed files
with
47 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
le-taxi-api-tests/src/osrm/loadTests/generateOsrmPayload.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Licensed under the AGPL-3.0 license. | ||
// See LICENSE file in the project root for full license information. | ||
import { getRandomNumberBetween } from "../../shared/commonLoadTests/randomData"; | ||
import { generatePointForLoadTest } from "../../shared/commonLoadTests/specialRegion"; | ||
|
||
// tslint:disable-next-line: no-console | ||
console.log( | ||
"WARNING: ALL LOAD TESTS MUST BE EXECUTED WITH A SINGLE REPLICA PER DEPLOYMENT!" | ||
); | ||
|
||
export function beforeGetRoute(context: any, ee: any, next: any) { | ||
const source = generatePointForLoadTest(); | ||
const dest = generatePointForLoadTest(); | ||
context.vars.taxiLat = source.lat; | ||
context.vars.taxiLon = source.lon; | ||
context.vars.clientLat = addOffset(source.lat); | ||
context.vars.clientLon = addOffset(source.lon); | ||
context.vars.destinationLat = dest.lat; | ||
context.vars.destinationLon = dest.lon; | ||
return next(); | ||
} | ||
|
||
function addOffset(value: number) { | ||
const offset = getRandomNumberBetween(-0.015, 0.015); | ||
return value + offset; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
config: | ||
target: "https://api.accept.interne.montreal.ca/api/taxi/taxi-registry-osrm" | ||
processor: "./generateOsrmPayload.js" | ||
http: | ||
pool: 1000 | ||
timeout: 35 | ||
phases: | ||
- name: "load test" | ||
arrivalRate: 1000 | ||
duration: 300 | ||
scenarios: | ||
- name: "OSRM test" | ||
flow: | ||
- function: "beforeGetRoute" | ||
- get: | ||
url: "/route/v1/car/{{taxiLon}},{{taxiLat}};{{clientLon}},{{clientLat}};{{destinationLon}},{{destinationLat}}?overview=false" |
16 changes: 0 additions & 16 deletions
16
le-taxi-api-tests/src/osrm/osrm-random-montreal-car-route-20rps.yaml
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
le-taxi-api-tests/src/osrm/osrm-random-montreal-car-route-5rps.yaml
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
le-taxi-api-tests/src/shared/commonLoadTests/randomPointInPolygon.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters