Options
All
  • Public
  • Public/Protected
  • All
Menu

Module components

Index

Type aliases

ContentScript

ContentScript: string

Javascript code to do something

IWrk

IWrk: { bodyData: string; connections: number; duration: string; info?: any; latency: boolean; saveTo?: string; script: string; threads: number; timeout: string; version: boolean }

Benchmark API

Type declaration

  • bodyData: string

    Request body data

  • connections: number

    Num of connection

  • duration: string

    Duration test

  • Optional info?: any

    Metadata info which include in result

  • latency: boolean

    Latency

  • Optional saveTo?: string

    Save result to

  • script: string

    Customize script which is imported in wrk

  • threads: number

    Num of threads

  • timeout: string

    Request timeout

  • version: boolean

    Version

TAG_KEEP

TAG_KEEP: "!keep"

Keep element in array

- Get:
    ->: base
    url: http://get...
    var: rs
    validate:
      - Status: 200
      - StatusText: OK

- Api:
    <-: base
    validate:
      - !remove     # Ignore validate status
      - !keep       # Validate Status text first
      - Status: 200 #Validate response status code must be 200

TAG_REMOVE

TAG_REMOVE: "!remove"

Remove element in array

- Get:
    ->: base
    url: http://get...
    var: rs
    validate:
      - Status: 200
      - StatusText: OK

- Api:
    <-: base
    validate:
      - !remove     # Ignore validate status
      - !keep       # Validate Status text first
      - Status: 200 #Validate response status code must be 200

TAG_UPLOAD

TAG_UPLOAD: "!upload"

Parse file to stream

- Post:
    baseURL: http://abc.com
    url: /upload
    headers:
      content-type: multipart/form-data
    body:
      name: img.jpg
      file: !upload examples/assets/text.txt
    query: 
      name: abc
    validate:
      - Status: [200, 204]