Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal of features such as Net classes, Date and a new theme. #72

Conversation

Rollbacke
Copy link
Contributor

Add RAM free, Disk used percent, Class Net, Class Date and bash-dark-green theme.

@Rollbacke
Copy link
Contributor Author

All themes are filled. Normally, I tested everything.

@mathoudebine
Copy link
Owner

Hello @Rollbacke
Thanks for this PR!
I see that you and @RussNelson opened almost the same PR, so i will not be able to merge both.

@RussNelson can you confirm the PR #65 and #67 are from @Rollbacke's code?
If so, would it be OK to close them and merge only this PR which has both?

library/stats.py Outdated
class Net:
@staticmethod
def stats():
pnic_before_file = "/tmp/pnic_before"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to avoid using an external file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I haven't found how to do it yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found how to do without temporary file.
I pushed the commit (below).

@Rollbacke
Copy link
Contributor Author

Rollbacke commented Nov 3, 2022

Hello @Rollbacke Thanks for this PR! I see that you and @RussNelson opened almost the same PR, so i will not be able to merge both.

@RussNelson can you confirm the PR #65 and #67 are from @Rollbacke's code? If so, would it be OK to close them and merge only this PR which has both?

Hi @mathoudebine,
These are indeed my proposals that I had put in the Issues.
I cleaned up and improved the code.
From what I suggested:

  • for the Net class, contained unnecessary lines and lacked checks that can crash the script (if the interface doesn't exist, it doesn't work).
  • for the Date class, since I wasn't using the strftime function, the date displayed "3-11-2022", which doesn't look pretty. With strftime, this is "03-11-2022".

In addition, I modified all of the themes (theme.yaml) to make it work.
I added the theme bash-dark-green I made myself.
I also added two metrics: RAM free, Disk used percent.

@Rollbacke
Copy link
Contributor Author

Oh. Sorry about that. I will fix that.

@Rollbacke
Copy link
Contributor Author

It's OK ;)

@mathoudebine mathoudebine merged commit 20a4030 into mathoudebine:main Nov 6, 2022
@mathoudebine
Copy link
Owner

Thanks @Rollbacke for this awesome work! PR has been merged and a new version will be created with your work 🚀

@mathoudebine mathoudebine linked an issue Nov 6, 2022 that may be closed by this pull request
@mathoudebine mathoudebine mentioned this pull request Nov 6, 2022
@mathoudebine mathoudebine linked an issue Nov 6, 2022 that may be closed by this pull request
@mathoudebine mathoudebine removed a link to an issue Nov 6, 2022
@mathoudebine mathoudebine linked an issue Nov 6, 2022 that may be closed by this pull request
@mathoudebine mathoudebine mentioned this pull request Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add network metrics Add date/time metrics
2 participants