mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 15:05:49 +03:00
[GH-ISSUE #773] Feature Requests: check statistics #543
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#543
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jeanpaulrh on GitHub (Jan 7, 2023).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/773
Hi, maybe I did not found what’s already there but I would like to have a percentage statistic of my check.
I can see the logs but for a check that runs quite often it’s difficult to find KO status or even have a glance of the success rate of the check maybe filtered for a given time period (1d, 1w, 1mo, 1y)
do you think it’s useful and possible?
@cuu508 commented on GitHub (Jan 12, 2023):
Hi @jeanpaulrh,
In the check's details page, "Current Status" section, you can see the uptime statistics for the current month and the previous two months:
Does that help?
@jeanpaulrh commented on GitHub (Jan 18, 2023):
Yes. Thank you. I missed it!
@SofianeHamlaoui commented on GitHub (Feb 15, 2023):
@cuu508 you think it'll be cool to have a percentage of failed & succeeded tasks ?
@cuu508 commented on GitHub (Feb 16, 2023):
@SofianeHamlaoui not sure, can you describe your idea a little more – how would be the percentage calculated, and where would it be displayed?
@SofianeHamlaoui commented on GitHub (Feb 20, 2023):
Example : in Dec 2022 it was down 3 times and the period is 1 week, means it failed 3 week checks, which means 3/4 of the checks failed.
Result : 75% failed, 25% succeeded.
Just a suggestion of course.
@cuu508 commented on GitHub (Feb 20, 2023):
Let's look at a few more examples.
Example I: at the start of Dec 2022, a check is up. During Dec 2022, the check receives no pings. So it changes state to down at the end of the first week, and stays down. What would be the success/failure percentages?
Example II: clients can explicitly signal failure. During entire Dec 2022, the check receives a failure signal every morning and a success signal every evening. In total, the check flips state from up to down 31 times. What would be the success/failure percentages?
Example III: at Dec 15, 2022, administrator changes the check's period to 1 day. At the end of the month, when calculating success/failure percentages, do we use 1 week as the period, or 1 day?
@SofianeHamlaoui commented on GitHub (Feb 21, 2023):
Example I : depends what day of Dec the check is down, so you can have the 31days of Dec as 100% means in this case it'll be ( let's say it went down the 6th day of the first week ) so it'll be round(6*100/31) = 19% UP & 81% DOWN
Example II : emm very good example, probably calculate the % of each day and then calculate the UP/Down per month ? but it can happen even if this is ment for cron jobs monitoring ?
Example III: joins the answer of Example 2 you are right, probably it'll be better if we calculate the success/failure percentages per day and than use them to have the month percentage.
Probably needs more digging, but if you need help to do this I'm open to it.
@cuu508 commented on GitHub (Feb 21, 2023):
OK, sounds like we would be calculating the percentage based on the time the check spent in down state, not based on the number of "down" events.
This would be fairly easy to do, since we already calculate the time:
In the above example, where it says "21 hours total", we could calculate the uptime percentage as 21 / (31 * 24) = 2.8%, and show it as: "2 downtimes, 21 hours total (97.2% uptime)"
@SofianeHamlaoui commented on GitHub (Feb 21, 2023):
yes, this would be it ! {{ down_duration_secs|hc_approx_duration }} / ( 24 * number of days )
for the number of days you can always use calendar.monthrange
monthrange(2023, 2)[1]>28@cuu508 commented on GitHub (Feb 21, 2023):
OK, but would there be much benefit from displaying the uptime as percentage? The user can already do the same calculation – approximately in head, or precisely using a calculator.
I'm interested in use cases – how often would you look up the uptime percentage, and what would you use it for?
(If it's just a fun statistic for the sake of curiosity, I'd rather not clutter the UI)
@SofianeHamlaoui commented on GitHub (Feb 21, 2023):
I personally use it in reports, just to use percentages and not just hours per day or days per week... to get a general view of the state of our cron jobs success rate.
@cuu508 commented on GitHub (Sep 28, 2023):
I've added uptime percentage display. Looks like so:
@SofianeHamlaoui commented on GitHub (Oct 10, 2023):
Perfect, sorry i've seen this in updates but didn't have time to answer this issue!
Thanks and good job with this tool, it's a real life/time saving tool !