Skip to content

Commit 8e3cf82

Browse files
authored
Merge pull request #19 from browserup/counters-renamed-metrics-add-dev-null
Counters renamed metrics add dev null
2 parents 1493e01 + 52b09ac commit 8e3cf82

478 files changed

Lines changed: 5135 additions & 17117 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This is a customized fork of the mitmproxy project, maintained by a company named browserup. The mitmproxy
2+
is used to man-in-the-middle connections to provide debugging info, allow for security research
3+
and other uses.
4+
5+
Browserup uses the mitmproxy to capture traffic from within containers that are run during a load test.
6+
This captured traffic, through mitmproxy addons, is used to build a HAR (HTTP Archive) file. The HAR
7+
file is made available via an API. The API is also used to control the proxy, and to add custom metrics
8+
to a har at runtime, as well as adding verifications for HAR content. Clients for
9+
this API are generated in multiple languages via the open api specification. The clients live in /clients
10+
which should be ignored, as they are generated files.
11+
12+
Browserup extends mitmproxy's mitmdump executable with addons
13+
The most important code for browserup live in mitmproxy/addons/browserup

browserup-proxy.schema.json

Lines changed: 87 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -337,30 +337,30 @@
337337
}
338338
}
339339
},
340-
"/har/counters": {
340+
"/har/metrics": {
341341
"post": {
342-
"description": "Add Custom Counter to the captured traffic har",
343-
"operationId": "addCounter",
342+
"description": "Add Custom Metric to the captured traffic har",
343+
"operationId": "addMetric",
344344
"tags": [
345345
"BrowserUpProxy"
346346
],
347347
"requestBody": {
348-
"description": "Receives a new counter to add. The counter is stored, under the hood, in an array in the har under the _counters key",
348+
"description": "Receives a new metric to add. The metric is stored, under the hood, in an array in the har under the _metrics key",
349349
"required": true,
350350
"content": {
351351
"application/json": {
352352
"schema": {
353-
"$ref": "#/components/schemas/Counter"
353+
"$ref": "#/components/schemas/Metric"
354354
}
355355
}
356356
}
357357
},
358358
"responses": {
359359
"204": {
360-
"description": "The counter was added."
360+
"description": "The metric was added."
361361
},
362362
"422": {
363-
"description": "The counter was invalid."
363+
"description": "The metric was invalid."
364364
}
365365
}
366366
}
@@ -594,17 +594,17 @@
594594
}
595595
}
596596
},
597-
"Counter": {
597+
"Metric": {
598598
"type": "object",
599599
"properties": {
600600
"name": {
601601
"type": "string",
602-
"description": "Name of Custom Counter to add to the page under _counters"
602+
"description": "Name of Custom Metric to add to the page under _metrics"
603603
},
604604
"value": {
605605
"type": "number",
606606
"format": "double",
607-
"description": "Value for the counter"
607+
"description": "Value for the metric"
608608
}
609609
}
610610
},
@@ -634,6 +634,77 @@
634634
}
635635
}
636636
},
637+
"WebSocketMessage": {
638+
"type": "object",
639+
"required": [
640+
"type",
641+
"opcode",
642+
"data",
643+
"time"
644+
],
645+
"properties": {
646+
"type": {
647+
"type": "string"
648+
},
649+
"opcode": {
650+
"type": "number"
651+
},
652+
"data": {
653+
"type": "string"
654+
},
655+
"time": {
656+
"type": "number"
657+
}
658+
}
659+
},
660+
"Header": {
661+
"type": "object",
662+
"required": [
663+
"name",
664+
"value"
665+
],
666+
"properties": {
667+
"name": {
668+
"type": "string"
669+
},
670+
"value": {
671+
"type": "string"
672+
},
673+
"comment": {
674+
"type": "string"
675+
}
676+
}
677+
},
678+
"Action": {
679+
"type": "object",
680+
"properties": {
681+
"name": {
682+
"type": "string"
683+
},
684+
"id": {
685+
"type": "string"
686+
},
687+
"className": {
688+
"type": "string"
689+
},
690+
"tagName": {
691+
"type": "string"
692+
},
693+
"xpath": {
694+
"type": "string"
695+
},
696+
"dataAttributes": {
697+
"type": "string"
698+
},
699+
"formName": {
700+
"type": "string"
701+
},
702+
"content": {
703+
"type": "string"
704+
}
705+
},
706+
"additionalProperties": false
707+
},
637708
"PageTimings": {
638709
"type": "object",
639710
"required": [
@@ -714,28 +785,6 @@
714785
}
715786
}
716787
},
717-
"CustomHarData": {
718-
"type": "object",
719-
"minProperties": 1
720-
},
721-
"Header": {
722-
"type": "object",
723-
"required": [
724-
"name",
725-
"value"
726-
],
727-
"properties": {
728-
"name": {
729-
"type": "string"
730-
},
731-
"value": {
732-
"type": "string"
733-
},
734-
"comment": {
735-
"type": "string"
736-
}
737-
}
738-
},
739788
"Har": {
740789
"type": "object",
741790
"required": [
@@ -814,59 +863,6 @@
814863
}
815864
}
816865
},
817-
"WebSocketMessage": {
818-
"type": "object",
819-
"required": [
820-
"type",
821-
"opcode",
822-
"data",
823-
"time"
824-
],
825-
"properties": {
826-
"type": {
827-
"type": "string"
828-
},
829-
"opcode": {
830-
"type": "number"
831-
},
832-
"data": {
833-
"type": "string"
834-
},
835-
"time": {
836-
"type": "number"
837-
}
838-
}
839-
},
840-
"Action": {
841-
"type": "object",
842-
"properties": {
843-
"name": {
844-
"type": "string"
845-
},
846-
"id": {
847-
"type": "string"
848-
},
849-
"className": {
850-
"type": "string"
851-
},
852-
"tagName": {
853-
"type": "string"
854-
},
855-
"xpath": {
856-
"type": "string"
857-
},
858-
"dataAttributes": {
859-
"type": "string"
860-
},
861-
"formName": {
862-
"type": "string"
863-
},
864-
"content": {
865-
"type": "string"
866-
}
867-
},
868-
"additionalProperties": false
869-
},
870866
"HarEntry": {
871867
"type": "object",
872868
"required": [
@@ -1326,6 +1322,10 @@
13261322
}
13271323
}
13281324
},
1325+
"CustomHarData": {
1326+
"type": "object",
1327+
"minProperties": 1
1328+
},
13291329
"Page": {
13301330
"type": "object",
13311331
"required": [
@@ -1353,10 +1353,10 @@
13531353
},
13541354
"default": []
13551355
},
1356-
"_counters": {
1356+
"_metrics": {
13571357
"type": "array",
13581358
"items": {
1359-
"$ref": "#/components/schemas/Counter"
1359+
"$ref": "#/components/schemas/Metric"
13601360
},
13611361
"default": []
13621362
},

0 commit comments

Comments
 (0)