Skip to content

Commit

Permalink
Add K8s generator (#62)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Stoklasa <[email protected]>
  • Loading branch information
noMoreCLI authored Jan 7, 2025
1 parent 7cd6aa2 commit 4dee53e
Show file tree
Hide file tree
Showing 20 changed files with 1,039 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
.history/

# Built Visual Studio Code Extensions
*.vsix
*.vsix
# Ignore local venv environment
.venv
# Ignore mac os x .DS_Store files
.DS_Store
143 changes: 143 additions & 0 deletions examples/generators/k8s/ad-insurance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#Simulated insurance application, will register the BTs listed under the Web-frontend tier.
#Note - some additional BTs will register during the first few runs, you should view # of calls and exclude accordingly.
#Performance Issue 1 - 500 Error on /homepage BT will happen 10% of the time
#Performance Issue 2 - Bad SQL Call & Slow execution on /processpolicy and /history BTs on 13% of calls
#Performance Issue 3 - Slow web service call for selectquote on 37% of calls
#TIP - You can run two versions of the script, upping the load and issues for one

services:
web-frontend:
type: java
agent: yes
endpoints:
http:
/login:
- http://accountservices/account/login
/homepage:
- http://accountservices/account/home
- cache,128
/getquote:
- http://accountservices/quote
/submitquote:
- http://accountservices/submitquote
/history:
- http://accountservices/policies
/startclaim:
- http://accountservices/startclaim
/submitclaim:
- http://accountservices/submitclaim
/processpolicy:
- http://accountservices/policies/process
accountservices:
type: java
agent: yes
endpoints:
http:
/account/login:
- slow,323
/account/home:
- slow,524
- call: error,500,Oops
probability: 0.1
/quote:
- http://quotesengine/quote
- http://quotesengine/query/quote
/policies:
- http://policymgt/query/policy
/submitquote:
- http://quotesengine/query/quote
/startclaim:
- http://claimservices/startclaim
/submitclaim:
- http://claimservices/submitclaim
/policies/process:
- http://policymgt/query/policy
- http://policymgt/processpolicy
claimservices:
type: java
agent: yes
endpoints:
http:
/startclaim:
- slow,725
/submitclaim:
- slow,623
policymgt:
type: java
agent: yes
port: 3007
endpoints:
http:
/query/policy:
- sql://policiesdb/policy?query=INSERT INTO policies(customer,coverage) VALUES('test',123)
- call: slow,9435
probability: 0.13
/processpolicy:
-call: slow,926
policiesdb:
type: mysql
databases:
policy:
policies: [id, customer, coverage]
quotesdb:
type: mysql
databases:
quote:
quotes: [id, customer, premium]
quotesengine:
type: java
agent: yes
port: 3008
endpoints:
http:
/query/quote:
- sql://quotesdb/quote?query=SELECT * FROM quotes
/quote:
- http://aggregator/aggregate
aggregator:
type: java
agent: yes
endpoints:
http:
/aggregate:
- http://carinsurance/quote
- http://policygenius/quote
- http://selectquote/quote
selectquote:
type: nodejs
agent: no
endpoints:
http:
quote:
- call: sleep, 4253
schedule: "*/5 * * * *"
probability: 0.37
policygenius:
type: nodejs
agent: no
endpoints:
http:
quote:
- call: sleep, 75
carinsurance:
type: nodejs
agent: no
endpoints:
http:
quote:
- call: sleep, 53

loaders:
browser:
type: curl
wait: 15
count: 5
urls:
- http://web-frontend/login
- http://web-frontend/homepage
- http://web-frontend/getquote
- http://web-frontend/homepage
- http://web-frontend/history
- http://web-frontend/startclaim
- http://web-frontend/submitclaim
- http://web-frontend/processpolicy
145 changes: 145 additions & 0 deletions examples/generators/k8s/config copy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
#Simulated insurance application, will register the BTs listed under the Web-frontend tier.
#Note - some additional BTs will register during the first few runs, you should view # of calls and exclude accordingly.
#Performance Issue 1 - 500 Error on /homepage BT will happen 10% of the time
#Performance Issue 2 - Bad SQL Call & Slow execution on /processpolicy and /history BTs on 13% of calls
#Performance Issue 3 - Slow web service call for selectquote on 37% of calls
#TIP - You can run two versions of the script, upping the load and issues for one
apm:
applicationName: AD-Insurance
controller:
accountName:
accountAccessKey:
eventsService:
globalAccountName:

services:
web-frontend:
type: java
port: 8888
agent: yes
endpoints:
http:
/login:
- http://accountservices/account/login
/homepage:
- http://accountservices/account/home
- cache,128
/getquote:
- http://accountservices/quote
/submitquote:
- http://accountservices/submitquote
/history:
- http://accountservices/policies
/startclaim:
- http://accountservices/startclaim
/submitclaim:
- http://accountservices/submitclaim
/processpolicy:
- http://accountservices/policies/process
/healthz:
- slow,524
- call: error,500,Oops
probability: 0.1
accountservices:
agent: yes
type: java
endpoints:
http:
/account/login:
- slow,323
/account/home:
- slow,524
- call: error,500,Oops
probability: 0.1
/quote:
- http://quotesengine/quote
- http://quotesengine/query/quote
/policies:
- http://policymgt/query/policy
/submitquote:
- http://quotesengine/query/quote
/startclaim:
- http://claimservices/startclaim
/submitclaim:
- http://claimservices/submitclaim
/policies/process:
- http://policymgt/query/policy
- http://policymgt/processpolicy
claimservices:
type: java
agent: yes
endpoints:
http:
/startclaim:
- slow,725
/submitclaim:
- slow,623
policymgt:
type: java
agent: yes
port: 3007
endpoints:
http:
/query/policy:
- sql://policiesdb/policy?query=INSERT INTO policies(customer,coverage) VALUES(test,123)
- call: slow,9435
probability: 0.13
/processpolicy:
-call: slow,926
quotesengine:
type: java
agent: yes
port: 3008
endpoints:
http:
/query/quote:
- sql://quotesdb/quote?query=SELECT * FROM quotes
/quote:
- http://aggregator/aggregate
aggregator:
type: java
agent: yes
endpoints:
http:
/aggregate:
- http://carinsurance/quote
- http://policygenius/quote
- http://selectquote/quote
selectquote:
type: java
agent: no
endpoints:
http:
quote:
- call: sleep, 4253
schedule: "*/5 * * * *"
probability: 0.37
policygenius:
type: java
agent: no
endpoints:
http:
quote:
- call: sleep, 75
carinsurance:
type: java
agent: no
endpoints:
http:
quote:
- call: sleep, 53

loaders:
browser:
type: puppeteer
wait: 15
count: 5
urls:
- http://web-frontend/login
- http://web-frontend/homepage
- http://web-frontend/getquote
- http://web-frontend/homepage
- http://web-frontend/history
- http://web-frontend/startclaim
- http://web-frontend/submitclaim
- http://web-frontend/processpolicy
42 changes: 42 additions & 0 deletions examples/generators/k8s/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
services:
service-a:
type: java
endpoints:
http:
/call/a:
- slow,256
/call/b:
- http://service-b/call/b
/call/c:
- http://service-b/call/c
service-b:
type: java
endpoints:
http:
/call/error:
- slow,256
/call/b:
- slow,256
/call/c:
- http://service-c/call/c
service-c:
type: java
endpoints:
http:
/call/error:
- slow,256
- call: error,500,Oops
probability: 0.5
/call/c:
- slow,256
loaders:
browser:
type: curl
wait: 15
count: 5
urls:
- http://service-a/call/a
- http://service-a/call/b
- http://service-a/call/c
- http://service-b/call/error
- http://service-c/call/error
Loading

0 comments on commit 4dee53e

Please sign in to comment.