Skip to content

Instantly share code, notes, and snippets.

@cmendesce
Last active October 21, 2023 14:03
Show Gist options
  • Select an option

  • Save cmendesce/d727ea01cb4b653a7b95b1400435679e to your computer and use it in GitHub Desktop.

Select an option

Save cmendesce/d727ea01cb4b653a7b95b1400435679e to your computer and use it in GitHub Desktop.

classDiagram direction LR

class Fault{
    <<Interface>>
    +List~int~ percentages
}
class AbortFault{
    +int statusCode
}
class DelayFault{
    +int duration
}

note for ResilientService "represents a k8s service"
class ResilientService{
+String name
+LabelSelector label
}

class ServiceUnderTest{
    +ResilientService service
    +Map~String, String~ patternConfig
    +Fault faultConfig
}

class Workload{
+List~int~ users
+int duration
+String locustConfig
}

class Scenario {
    +String name
    +List~ServiceUnderTest~
}

class Benchmark{
+int rounds
+List~Scenario~ scenarios
+Workload workload
}

Fault <|-- AbortFault
Fault <|-- DelayFault

ServiceUnderTest o-- Fault : 1..N
ServiceUnderTest o-- ResilientService : 1..N

Scenario o-- ServiceUnderTest : 1..N
Benchmark o-- Workload : 1..N
Benchmark o-- Scenario : 1..N
apiVersion: "resiliencebench.io/v1"
kind: ResilientService
metadata:
name: api-gateway
annotations:
resiliencebench.io/library: resilience4j
spec:
selector:
matchLabels:
com.petclinic.service: api-gateway
---
apiVersion: "resiliencebench.io/v1"
kind: ResilientService
metadata:
name: customers-service
annotations:
resiliencebench.io/library: resilience4j
spec:
selector:
matchLabels:
com.petclinic.service: customers-service
---
apiVersion: "resiliencebench.io/v1"
kind: Workload
metadata:
name: ten-users-linear-load
spec:
users: [ 10 ]
duration: 30
targetUrl: "http://server:9211/bytes/1000"
locustFileConfigMap: "locustfile.py"
---
apiVersion: "resiliencebench.io/v1"
kind: Benchmark
metadata:
name: bm-1
spec:
rounds: 10
workload: ten-users-linear-load
scenarios:
- name: all-services-with-retry
connections:
- name: aresta-1
source:
service: api-gateway
patternConfig:
maxAttempts: 6
multiplier: 1.5
initialIntervalMillis: [ 50 ]
target:
service: customer-services
fault:
delay:
percentage: [ 50, 75 ]
duration: 100
- name: aresta-2
source:
service: api-gateway
patternConfig:
maxAttempts: 6
multiplier: 1.5
initialIntervalMillis: [ 50 ]
target:
service: vets-services
fault:
delay:
percentage: [ 50, 75 ]
duration: 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment