https://github.com/infinilabs/loadgen-dsl
๐งจ A easy to use and human-friendly DSL for conducting test assessments with INFINI Loadgen.
https://github.com/infinilabs/loadgen-dsl
asset dsl loadgen testing
Last synced: over 1 year ago
JSON representation
๐งจ A easy to use and human-friendly DSL for conducting test assessments with INFINI Loadgen.
- Host: GitHub
- URL: https://github.com/infinilabs/loadgen-dsl
- Owner: infinilabs
- License: other
- Created: 2024-09-10T10:53:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-10T11:10:54.000Z (almost 2 years ago)
- Last Synced: 2025-01-05T19:11:59.756Z (over 1 year ago)
- Topics: asset, dsl, loadgen, testing
- Language: Rust
- Homepage: https://release.infinilabs.com/loadgen/
- Size: 770 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ Loadgen DSL
The assertion DSL for Loadgen.
## โ๏ธ Example
`loadgen-dsl` compiles a little DSL to the yaml configuration of Loadgen.
```sh
# Build WASM module and run it from Golang
just run examples/example.dsl
```
Output:
```txt
and:
- equals:
_ctx.response.body_json.name: lchynn
- range:
_ctx.response.body_json.age:
gte: -22.0
- equals:
_ctx.response.body_json.com: infini
- or:
- regexp:
_ctx.response.body_json.team: dev.*
- regexp:
_ctx.response.body_json.team: doc.*
- and:
- equals:
_ctx.response.body_json.todo.pizza: inprogress
- equals:
_ctx.response.body_json.todo.dsl: inprogress
- and:
- equals:
_ctx.response.body_json.likes.0: anime
- equals:
_ctx.response.body_json.likes.1: sports
```
## ๐ฒ Grammer
```bnf
grammer ::= brief | full
brief ::= status? object EOF
full ::= fields EOF
status ::= integer
expr ::= expr1 (infixop expr1)*
expr1 ::= literal
| array
| object
| funcall
| prefixop expr1
| '(' exprlist ')'
exprlist ::= (expr (',' expr)* ','?)?
object ::= '{' fields '}'
fields ::= (pair (',' pair)* ','?)?
pair ::= path ':' expr
path ::= key ('.' key)*
key ::= name | string | integer
array ::= '[' exprlist ']'
funcall ::= name '(' exprlist ')'
literal ::= null
| boolean
| integer
| float
| regex
| string
ignore ::= whitespace
| comment
/* ws: definition */
comment ::= '//' char*
name ::= ident - keyword
keyword ::= 'null'
| 'true'
| 'false'
| 'not'
| 'and'
| 'or'
ident ::= id_start (id_start | '-' | digit)*
id_start ::= [_a-zA-Z]
prefixop ::= '-'
| '>'
| '<'
| '>='
| '<='
| '=='
| 'not'
infixop ::= 'and' | 'or'
null ::= 'null'
boolean ::= 'true' | 'false'
integer ::= digit+
exponent ::= ('e' | 'E') ('+' | '-')? integer
float ::= integer exponent
| integer '.' integer exponent?
digit ::= [0-9]
regex ::= '/' ('\/' | char - '/')+ '/'
string ::= '"' (escape | char - '"')* '"'
| "'" (escape | char - "'")* "'"
escape ::= '\b'
| '\f'
| '\n'
| '\r'
| '\t'
| "\'"
| '\"'
| '\\'
| '\/'
char ::= #x9
| [#x20-#xD7FF]
| [#xE000-#xFFFD]
| [#x10000-#x10FFFF]
whitespace ::= [#x9#xA#xD#x20]+
EOF ::= $
```
### References:
- [W3C EBNF Notation](https://www.w3.org/TR/2008/REC-xml-20081126/#sec-notation)
- [REx Parser Generator](https://bottlecaps.de/rex/)
## โ๏ธ License
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or
)
at your option.