pry0cc / axiom

The dynamic infrastructure framework for everybody! Distribute the workload of many different scanning tools with ease, including nmap, ffuf, masscan, nuclei, meg and many more!
MIT License
4.06k stars 645 forks source link

Log uptime and amount of money an instance or cluster spent to print it out at axiom-rm #537

Open ibitebyt3s opened 2 years ago

ibitebyt3s commented 2 years ago

Feature Request:

I've been having this idea circling my mind since quite a while and since I can't find time to submit a PR I think it's better to at least have it "on the table" than just in my mind...

I think it would be great that every time a user runs axiom-rm a message displaying the uptime and money cost would be printed to the stdout. That would be for each individual machine and the total of all the deleted machines at the particular axiom-rm call. This could optionally be extended to displaying the total uptime and money cost of the current month.

Regarding to the feature implementation I haven't totally designed it not even in my head but I have a basic idea. It would work by creating a logfile under the home .axiom directory that would log two things: 1) the start date and time of each instance, 2) the hourly cost of each instance. This data would be logged every time a new instance is created regardless of which axiom command was called but to begin implementing this feature, we could try with only axiom-fleet and axiom-init. The data will be there untouched as long as the instance isn't called by axiom-rm. When it does get called, it would calculate the necessary math to display the previously said messages.

I know this feature would require some days or weeks of testing to ensure the accuracy of the costs calculator besides whatever else that could and will come up.

That would be basically it 🤔

0xtavian commented 2 years ago

@ibitebyt3s I love this idea :). I’ve been thinking about displaying the dollar amount spent for the current billing cycle any time axiom-ls is run.

Have you checked $HOME/.axiom/stats.log yet? It currently logs axiom-init/fleet and axiom-scan tasks, I planned on incorporating axiom-rm. Let me know how you like it.