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

Add BIENNIALLY & TRIENNIALLY stats on TaskMonitor #3721

Merged

Conversation

caos30
Copy link
Contributor

@caos30 caos30 commented Jun 27, 2023

Hello, i love your work with Hestia and i cannot pay to you so good work!! But here is my first pull request :-)

I like consult TaskMonitor to see load, memory, etc. of my servers. And i have both of them with just more than 2 years of use of hestia... so i decided to dedicate my day to add to new BUTTONS on TaskMonitor: BIENNIALLY and TRIENNIALLY (besides to daily, weekly, monthly and yearly).

The "change" is quite easy. I've only searched where appeared "yearly" on the source code of Hestia and added the 2 new options. I've tested it on both servers of mine and it works "fine".

Well, in fact, i've modified (in the pull request):

web/js/src/rrdCharts.js

but on production server i had to apply the same modification to this other minimized file:

web/js/dist/main.min.js

I suspect that this second file is generated from you when creating the stable branch or the release of the new stable version. Am i wrong? I mean, i think that i had not to do it, right? Tell me how please... because i really have no experience minimizing files.

Another comment

I know that you changed the graph library for this kind of charts. So i suspect that these other files are now obsolete and could be removed?

/usr/local/hestia/bin/v-update-sys-rrd-la 
/usr/local/hestia/bin/v-update-sys-rrd-ssh
/usr/local/hestia/bin/v-update-sys-rrd-mysql
/usr/local/hestia/bin/v-update-sys-rrd-nginx
/usr/local/hestia/bin/v-update-sys-rrd-net
/usr/local/hestia/bin/v-update-sys-rrd-mem
/usr/local/hestia/bin/v-update-sys-rrd-httpd
/usr/local/hestia/bin/v-update-sys-rrd-pgsql
/usr/local/hestia/bin/v-update-sys-rrd-apache2
/usr/local/hestia/bin/v-update-sys-rrd-mail
/usr/local/hestia/bin/v-update-sys-rrd-ftp

I've not removed it!! i only mention it to remember to you that maybe they could be removed. Because, for example in my case, i've "wasting" one hour until understand that modifying these files the graphs on TaskMonitor didn't changed! :_(

Last comment: translation?

This is my first direct collaboration with your project... i don't know where you manage translations... so i only added that 2 buttons so here /usr/local/hestia/web/templates/pages/list_rrd.php:

... href="?period=biennially"><?= _("Biennially") ?></a>
... href="?period=triennially"><?= _("Trienially") ?></a>

@jaapmarcus
Copy link
Member

Translations are managed via Crowdin and the source files are auto generated via gettext after merging into the main branch... So that should be sorted by it self.

We build the javascript / css on "building" the packages.. See https://main.hestiacp.pages.dev/docs/contributing/building.html#installing-hestia-from-a-branch to how to do it..

nom -i 
npm run build 

Should do the trick..

I wonder if we should just add a custom option and allow the user to pick yyyy-mm-dd start / end date and convert it to strtotime to an valid time stamp.

As is it used anyways ..

echo $(date -d "3 years  ago" +%s)
1593240422

@caos30
Copy link
Contributor Author

caos30 commented Jun 27, 2023

Yes, @jaapmarcus, I thought the same as you. It would probably be interesting to add two datepickers to choose a custom range of dates. However, there are a few things to consider:

  1. I don't have enough knowledge about the generation of the RRD files. In fact, this is the first time I've come across them. 😅 So, I'm not quite sure if it will be necessary to modify the script that builds these "raw" data files for the graph. I suspect that these files contain all the necessary data from the start of the VM to the current time, pre-processed, and the graph script selects the "useful" data. But I'm not certain. As you can see, my understanding is limited in this area.

  2. I'm not familiar with how other users are using this TaskMonitor section, but personally, I usually find it sufficient to see the data for the last 24 hours, the past week, and occasionally the annual graph for more in-depth analysis. I don't think many people would be interested in a graph showing the exact 24-hour data from the previous month, for example. However, there may be some who find it useful.

  3. I needed to add the "biennially" and "triennially" graphs because my SaaS (with Hestia at its core 😁) heavily depends on seasonal patterns. At the end of June, it's crucial for me to evaluate and estimate if the workload will be more or less intense compared to the previous year. To do this, I need to compare the data from the last 24 months, which usually shows the increase in work from one year to another. Unfortunately, the yearly graph doesn't provide me with the necessary information for this comparison.

My usual approach is to take incremental steps. I'll familiarize myself more with all of this, and hopefully, one day, I'll try to implement the "pick date range" option. 😊

Thank you for being there!

Sergi

@caos30
Copy link
Contributor Author

caos30 commented Jun 27, 2023

I apologize, but this is my first time working with Prettier, so I'm currently attempting to run the checks twice. I hope that it is correct this time, although I'm not entirely certain. 😅

@jaapmarcus jaapmarcus force-pushed the feature/biennially-and-triennially-stats branch from c499580 to fab75a9 Compare June 28, 2023 09:44
@jaapmarcus jaapmarcus merged commit 98bc6cd into hestiacp:main Jun 28, 2023
5 of 6 checks passed
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.

None yet

2 participants