monika icon indicating copy to clipboard operation
monika copied to clipboard

779/refactor: Request and response in verbose mode

Open herenacreative opened this issue 2 years ago • 3 comments

Monika Pull Request (PR)

What feature/issue does this PR add

  1. 779/refactor: Request in verbose mode

How did you implement / how did you fix it

How to test

  1. bin/run --verbose

send request: Screen Shot 2022-08-18 at 09 18 17

herenacreative avatar Aug 03 '22 07:08 herenacreative

Codecov Report

Merging #844 (3f8845d) into main (8af1200) will decrease coverage by 0.10%. The diff coverage is 30.00%.

@@            Coverage Diff             @@
##             main     #844      +/-   ##
==========================================
- Coverage   49.35%   49.25%   -0.11%     
==========================================
  Files          71       71              
  Lines        2395     2408      +13     
  Branches      469      480      +11     
==========================================
+ Hits         1182     1186       +4     
- Misses       1034     1042       +8     
- Partials      179      180       +1     
Impacted Files Coverage Δ
src/components/logger/request-log.ts 7.54% <7.14%> (+0.72%) :arrow_up:
src/index.ts 54.21% <83.33%> (+0.51%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Aug 03 '22 07:08 codecov[bot]

@herenacreative Ok... im getting the request.. good. Still not getting response though

image

sapiderman avatar Aug 09 '22 05:08 sapiderman

@herenacreative still need to update the probes config, especially need to format it so that it's clear that there are multiple requests in a probe.

Currently,

Probes:
- Probe ID: 1
    Name: GitHub
    Description: Multiple
    Interval: 20
    Request Method: GET
    Request URL: https://github.com
    Request Headers: -
    Request Body: -
    Request Method: GET
    Request URL: https://github.com/hyperjump
    Request Headers: -
    Request Body: -
    Alerts: [{ "query": "response.status < 200 or response.status > 299", "message": "HTTP Status is not 200"},
            { "query": "response.time > 2000", "message": "Response time is more than 2000ms" }]

It's better to be,

Probes:
- Probe ID: 1
    Name: GitHub
    Description: Multiple
    Interval: 20
    Requests:
      - Request Method: GET
         Request URL: https://github.com
         Request Headers: -
         Request Body: -
      - Request Method: GET
         Request URL: https://github.com/hyperjump
         Request Headers: -
         Request Body: -
    Alerts: [{ "query": "response.status < 200 or response.status > 299", "message": "HTTP Status is not 200"},
            { "query": "response.time > 2000", "message": "Response time is more than 2000ms" }]

Also, format the alerts so that it doesn't look like JSON.

Basically, they should look like the YAML format.

nicnocquee avatar Aug 16 '22 20:08 nicnocquee