Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: tools/telemetry/third_party/webpagereplay/documentation/Rules.md

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/third_party/webpagereplay/documentation/Rules.md
diff --git a/tools/telemetry/third_party/webpagereplay/documentation/Rules.md b/tools/telemetry/third_party/webpagereplay/documentation/Rules.md
deleted file mode 100644
index 35176357d588cf858c0e7609c9604f39d359bf90..0000000000000000000000000000000000000000
--- a/tools/telemetry/third_party/webpagereplay/documentation/Rules.md
+++ /dev/null
@@ -1,95 +0,0 @@
-WebPageReplay Rule Language
-===========================
-
-WebPageReplay rules allows developers to customize record/replay handling.
-
-Motiviation
------------
-
-Web sites often require custom replay logic, e.g.:
-
- 1. The recording uploads various metrics/logs to:
-
- http://example.com/gen_204?emsg=foo
-
- but, during replay, it uploads different parameters:
-
- http://example.com/gen_204?emsg=bar
-
- so (as-is) our replay fails. We want "*/gen_204" to always respond
- "HTTP 204 No Change".
-
- 2. The recording fetches data from one server:
-
- http://mirrorA.example.com/stuff
-
- but replay selects a different server:
-
- http://mirrorB.example.com/stuff
-
- which breaks replay. We want "mirror*.example.com/stuff" to be equivalent.
-
- 3. The recorded URL + response contains a UID, e.g.:
-
- http://example.com?q=foo --> "you sent foo."
-
- but the replay asks for:
-
- http://example.com?q=bar --> replay error!
-
- We want it to reply "you sent bar."
-
-We could hack all the above rules into the code, but that can''t be (cleanly) extended or open sourced.
-
-Instead, we want a simple config file of "predicate --> action" rules.
-
-
-Format
-------
-
-The JSON-formatted rule file is specified on the command line:
-
- replay.py ... --rules_path my_rules ...
-
-The rules file must contain an array of single-item objects, e.g.:
-
- [{"comment": "ignore me"},
- {"LogUrl": {"url": "example\\.com/logme.*"}},
- {"LogUrl": {"url": "example\\.com/someotherpath"}}
- ]
-
-All "comment" items are ignored and support arbitrary values, e.g., a string
-or commented-out rule(s).
-
-All other items must specify a string TYPE key and object ARGS value, e.g.:
-
- {"LogUrl": {"url": "example\\.com/test", "stop": false}}
-
-The default TYPE package is "rules" and the default rule_parser
-"allowed_imports" is similarly restricted to only allow "rules" classes.
-
-The TYPE implementation class must match the Rule API defined in
-"rules/rule.py":
-
- class Rule(object):
- def IsType(self, rule_type_name): ...
- def ApplyRule(self, return_value, request, response): ...
-
-The ARGS must match the rule-specific constructor, e.g.:
-
- class LogUrl(rule.Rule):
- def __init__(self, url, stop=False):
- self._url_re = re.compile(url)
- self._stop = stop
- ...
-
-All rules of the same rule_type_name are chained together and applied in the
-same order as they appear in the input JSON file.
-
-
-Rules
--------
-
-### rules.LogUrl:
-
-If the url pattern matches then log the request URL.

Powered by Google App Engine
This is Rietveld 408576698