Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea
*/build
*/node_modules
target
h2.db.mv.db
cache
Expand Down Expand Up @@ -221,4 +222,4 @@ Temporary Items
*.icloud

py-venv
# End of https://www.toptal.com/developers/gitignore/api/macos
# End of https://www.toptal.com/developers/gitignore/api/macos
98 changes: 98 additions & 0 deletions performance-tests/finance-analytics-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
config:
target: "http://localhost:8888/graphql"
phases:
- duration: 30
arrivalRate: 50
rampTo: 200
name: "Warm up phase"
- duration: 60
arrivalRate: 200
rampTo: 500
name: "Load increase phase"
- duration: 120
arrivalRate: 500
rampTo: 1000
name: "Heavy load phase"
- duration: 300
arrivalRate: 1000
name: "Extreme load phase"
engines:
http:
maxSockets: 2000
defaults:
headers:
Content-Type: "application/json"
Accept: "application/json"

scenarios:
- name: "Query Transactions"
weight: 5
flow:
- post:
url: "/"
json:
query: |
query GetTransactions($customerid: Int!, $fromTime: DateTime!, $toTime: DateTime!) {
Transactions(customerid: $customerid, fromTime: $fromTime, toTime: $toTime) {
transactionId
cardNo
time
amount
merchantName
category
}
}
variables:
customerid: "{{ $randomNumber(1, 9) }}"
fromTime: "{{ fromTime }}"
toTime: "{{ toTime }}"
ensure:
statusCode: [ 200, 429, 500, 503 ]
capture:
- json: "$.data.Transactions"
as: "transactions"
- log: "Retrieved {{ transactions.length }} transactions"

- name: "Query Spending By Category"
weight: 3
flow:
- post:
url: "/"
json:
query: |
query GetSpendingByCategory($customerid: Int!, $limit: Int!) {
SpendingByCategory(customerid: $customerid, limit: $limit) {
timeWeek
category
spending
}
}
variables:
customerid: "{{ $randomNumber(1, 9) }}"
limit: 24
ensure:
statusCode: [ 200, 429, 500, 503 ]
capture:
- json: "$.data.SpendingByCategory"
as: "spendingCategories"
- log: "Retrieved {{ spendingCategories.length }} category spending records"

- name: "Query Spending By Day"
weight: 2
flow:
- post:
url: "/"
json:
query: |
query GetSpendingByDay($customerid: Int!, $fromTime: DateTime!, $toTime: DateTime!) {
SpendingByDay(customerid: $customerid, fromTime: $fromTime, toTime: $toTime) {
timeDay
spending
}
}
variables:
customerid: "{{ $randomNumber(1, 9) }}"
fromTime: "{{ fromTime }}"
toTime: "{{ toTime }}"
ensure:
statusCode: [ 200, 429, 500, 503 ]
121 changes: 121 additions & 0 deletions performance-tests/finance-rewards-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
config:
target: "http://localhost:8888/graphql"
phases:
- duration: 30
arrivalRate: 50
rampTo: 200
name: "Warm up phase"
- duration: 60
arrivalRate: 200
rampTo: 500
name: "Load increase phase"
- duration: 120
arrivalRate: 500
rampTo: 1000
name: "Heavy load phase"
- duration: 300
arrivalRate: 1000
name: "Extreme load phase"
engines:
http:
maxSockets: 2000
defaults:
headers:
Content-Type: "application/json"
Accept: "application/json"

scenarios:
- name: "Query Rewards"
weight: 5
flow:
- post:
url: "/"
ensure:
statusCode: [ 200, 429, 500, 503 ]
json:
query: |
query GetRewards($customerid: Int!, $fromTime: DateTime!, $toTime: DateTime!) {
Rewards(customerid: $customerid, fromTime: $fromTime, toTime: $toTime) {
transactionId
cardNo
cardType
time
amount
reward
merchantName
}
}
variables:
customerid: "{{ $randomNumber(1, 9) }}"
fromTime: "{{ fromTime }}"
toTime: "{{ toTime }}"
capture:
- json: "$.data.Rewards"
as: "rewards"
- log: "Retrieved {{ rewards.length }} rewards"

- name: "Query Rewards By Week"
weight: 3
flow:
- post:
url: "/"
ensure:
statusCode: [ 200, 429, 500, 503 ]
json:
query: |
query GetRewardsByWeek($customerid: Int!, $limit: Int!) {
RewardsByWeek(customerid: $customerid, limit: $limit) {
timeWeek
total_reward
}
}
variables:
customerid: "{{ $randomNumber(1, 9) }}"
limit: 12
capture:
- json: "$.data.RewardsByWeek"
as: "weeklyRewards"
- log: "Retrieved {{ weeklyRewards.length }} weekly rewards"

- name: "Query Total Reward"
weight: 2
flow:
- post:
url: "/"
ensure:
statusCode: [ 200, 429, 500, 503 ]
json:
query: |
query GetTotalReward($customerid: Int!) {
TotalReward(customerid: $customerid) {
total_reward
since_time
}
}
variables:
customerid: "{{ $randomNumber(1, 9) }}"

- name: "Query Potential Rewards"
weight: 3
flow:
- post:
url: "/"
ensure:
statusCode: [ 200, 429, 500, 503 ]
json:
query: |
query GetPotentialRewards($customerid: Int!, $cardType: String!, $fromTime: DateTime!, $toTime: DateTime!) {
PotentialRewards(customerid: $customerid, cardType: $cardType, fromTime: $fromTime, toTime: $toTime) {
transactionId
rewardCardType
time
amount
reward
merchantName
}
}
variables:
customerid: "{{ $randomNumber(1, 9) }}"
cardType: "{{ cardType }}"
fromTime: "{{ fromTime }}"
toTime: "{{ toTime }}"
Loading