arriven / db1000n

MIT License
1.17k stars 200 forks source link

Simple output improvements (also make simple output format default) #519

Closed roman-kruglov closed 2 years ago

roman-kruglov commented 2 years ago

Description

I want to improve it further to show a pretty summary like before. For this I split Reporter into several implementations - for zap and console.

Also simple output format is made default now.

It's a work in progress - I intend to split mectrics.go into several files. But I hope it gives a preview of what's coming if somebody touches same files.

P.S. I intend to finish this somewhere around today's evening.

Type of change

if some scripts or bots use json as default now - we need to update those before releasing - the default becomes simple.

How Has This Been Tested?

By running and looking at the output in a terminal.

Test Configuration

Logs

Output sample (real values crossed out, truncated for shorter text, alignment in console is better)

single http request     {"target": "https://sample/"}
single http request     {"target": "https://sample"}

 --- Traffic stats ---
 |                                Target | Requests attempted | Requests sent | Responses received | Data sent |
 |                  http://xx.xx.xx.xx |                  1 |                   0 |                  0 |     0.00 MB |
 |                  http://xx.xx.xx.xx |                  3 |                  0 |                  0 |     0.00 MB |
 |                        http://sample |                  2 |                  0 |                  0 |     0.00 MB |
 |                      https://sample |                  1 |                   0 |                  0 |     0.00 MB |
 |                                         --- |               --- |                --- |               --- |              --- |
 |                                      Total |   14623715 |    14620788 |           1490 | 139.66 MB |

loading config  {"path": "https://sample/config.json"}
the config has not changed. Keep calm and carry on!
roman-kruglov commented 2 years ago

Guys, could somebody look through the pr with a fresh eye to make sure I didn't fuck up memory somewhere. Pretty exhausted right now, I'll skim over it again in the morning.