arriven / db1000n

MIT License
1.18k stars 208 forks source link

How to get the table output that was introduced in v8.0.23? #516

Closed sadviq99 closed 2 years ago

sadviq99 commented 2 years ago

In the version v8.0.23 in the PR https://github.com/Arriven/db1000n/pull/484 was introduced a nice table output format, but now I don't see an option to enable it back. Is this possible or would it be possible in the future?

 --- Traffic stats ---
 |            Target | Requests attempted | Requests sent | Responses received | Data sent | Data received |
 | http://foobar.com |               1100 |           110 |                 11 |  17.19 MB |       4.30 MB |
 |  tcp://foobar.com |               1100 |           110 |                 11 |   1.72 MB |       0.43 MB |
 |               --- |                --- |           --- |                --- |       --- |           --- |
 |             Total |               2200 |           220 |                 22 |  18.91 MB |       4.73 MB |

The critical information is Total values, how to get them with the new output format?

I'm building a Telegram notifications based on the db1000n output, so I'm looking for more or less stable output format.

Thank you.

arriven commented 2 years ago

Right now this same output is printed as json, although there's also PRs #517 and #518 that might change the format a bit (I plan to switch default format to simple but json will be available as commandline option)

I think it would be easier to parse json output but if you do implement this bot before 0.8.31 be careful about those changes

arriven commented 2 years ago

I've also seen you discussed response rate in that issue you linked, the easiest way to calculate that now is to use requests_sent/requests_attempted but to have the most viable stats you should probably filter out udp and ip targets as they don't track delivery in any way Right now most of the changes to json logs are in master so you can probably already test the implementation, I doubt it'll have many changes before the release. The only thing worth doing is forcing it to output json logs by specifying --log-format json in case we find a way to pretty print those stats in simple format and switch default format to it (I kinda doubt it though)

sadviq99 commented 2 years ago

@Arriven yes, I already updated my bot to use JSON output, I guess it was easier to parse than plain text in the table output. https://github.com/sadviq99/db1000n-setup/pull/6

Thank you very much for the meaningful insights on the response rate calculation, I will try to implement this by myself. But why that metric was removed from the original reporting? I think a lot of users relied on that as on the main efficiency indicator. Any plans to get it back?

The issue can be closed I guess, since that’s not an issue anymore. Thank you for your work 🇺🇦

arriven commented 2 years ago

Just make sure to update the script for 0.8.31 which I plan to release tomorrow morning

roman-kruglov commented 2 years ago

@Arriven @sadviq99 guys, I'm working on exactly this in #519 - to bring the table back for the simple terminal-oriented output. I hope to finish and polish it today's evening

arriven commented 2 years ago

@sadviq99 0.8.32 brings back table format by default, but you can still use json one (which is probably better for automated parsing) by specifying --log-format json