Skip to content

Instantly share code, notes, and snippets.

View cmendesce's full-sized avatar

Carlos Mendes cmendesce

View GitHub Profile
+-----------+
| |
+-----------+ Customer +-----------+
| | | |
+----------+ +-----+----+ | | +----+-----+
| | | | +-----------+ | |
| End-User +------+ Realm | | End-User |
| | | | | |
| | | | | |
+----------+ +-----+----+ +----+-----+
{"results":[{"root_group":{"id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"name":"status_200","path":"::status_200","id":"eb43ed48051ffd42f90320828fc3e3f2","passes":500,"fails":0},{"passes":0,"fails":500,"name":"status_500","path":"::status_500","id":"8dcec7f2b460ed09a477488eaf6bfa7f"},{"fails":117,"name":"details_loaded","path":"::details_loaded","id":"ea72662fb6e6a1197a0227e66f97ca1e","passes":383},{"name":"reviews_loaded","path":"::reviews_loaded","id":"c2564855d4fb9159e553ef9df0a01dfa","passes":500,"fails":0},{"path":"::ratings_loaded","id":"4bbb6400bc92e2251718045023780b3d","passes":500,"fails":0,"name":"ratings_loaded"}],"name":"","path":""},"options":{"summaryTimeUnit":"","noColor":false,"summaryTrendStats":["avg","min","med","max","p(90)","p(95)"]},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":35913.641961},"metrics":{"http_req_duration{expected_response:true}":{"type":"trend","contains":"time","values":{"avg":3506.9984064079995,"min":5.508542,"med":5013.0197525,
{"results":[{"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"name":"status is 200","path":"::status is 200","id":"6210a8cd14cd70477eba5c5e4cb3fb5f","passes":90,"fails":10}]},"options":{"summaryTrendStats":["avg","min","med","max","p(90)","p(95)"],"summaryTimeUnit":"","noColor":false},"state":{"testRunDurationMs":6551.769753,"isStdOutTTY":false,"isStdErrTTY":false},"metrics":{"custom_successfulCalls":{"type":"counter","contains":"default","values":{"count":0,"rate":0}},"data_sent":{"type":"counter","contains":"data","values":{"count":24500,"rate":3739.4476490541592}},"data_received":{"contains":"data","values":{"count":40662,"rate":6206.262053299601},"type":"counter"},"http_req_failed":{"type":"rate","contains":"default","values":{"passes":10,"fails":90,"rate":0.1}},"iteration_duration":{"values":{"p(90)":1866.3735091000028,"p(95)":3045.9693927000003,"avg":651.83704411,"min":41.135542,"med":240.4328125,"max":3061.703835},"type":"trend","contains":"time"},"check
apiVersion: resiliencebench.io/v1beta1
kind: Benchmark
metadata:
name: bookinfo
namespace: bookinfo
spec:
rounds: 5
workload: loadtest
connections:
- name: productpage-reviews

classDiagram direction LR

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

}

@cmendesce
cmendesce / logs-retry.md
Last active December 10, 2022 14:11
testes retry pattern - polly e r4j

Polly

retry: 5 backoff: Math.Pow(2, retryNumber) * 500

execução
tentativa 1; tempo de espera 00:00:01
execução
tentativa 2; tempo de espera 00:00:02
This file has been truncated, but you can view the full file.
storage 2022-05-03 16:24:47,932 INFO File /opt/app/resilience-tests/Tue May 03 13h24m47s 2022/scenarios-original.json saved to disk
app 2022-05-03 16:24:47,932 INFO 4860 scenarios generated
storage 2022-05-03 16:24:47,937 INFO File /opt/app/resilience-tests/Tue May 03 13h24m47s 2022/scenarios.json saved to disk
app 2022-05-03 16:24:47,938 INFO group[f0u25] starting processing 60 scenarios
app 2022-05-03 16:24:47,938 INFO group[f0u25] processing scenario 1/60
envoy 2022-05-03 16:24:48,039 INFO Disabled delay fault injection in envoy
envoy 2022-05-03 16:24:48,096 INFO Enabled 503 abort fault injection in envoy for 0% of requests
app 2022-05-03 16:24:49,649 INFO group[f0u25] collecting user results 1/25
app 2022-05-03 16:24:49,651 INFO group[f0u25] collecting user results 2/25
app 2022-05-03 16:24:49,651 INFO group[f0u25] collecting user results 3/25
{
"fault": {
"percentage": [25, 50, 75],
"duration": 3000
},
"concurrentUsers": [1, 25, 50, 100],
"rounds": 10,
"maxRequestsAllowed": 1000,
"targetSuccessfulRequests": 20,
"patterns": [
{
"envoy_host": "http://envoy:9100",
"failure_rate": [50],
"concurrentUsers": [1],
"rounds": 5,
"patterns": [
{
"name": "polly-retry",
"platform": "dotnet",
"lib": "polly",
[
  {
    "clientId": 1, # identificador único do cliente
    "concurrentClients": 100, # número de clientes simultâneos 
    "resilienceModule": [
      {
        "successfulRequest": 25, # requests com sucesso
        "unsuccessfulRequests": 14, # requests com erro
 "totalRequests": 39, # soma de requests com e sem erro