[GH-ISSUE #773] Feature Requests: check statistics #543

Closed
opened 2026-02-25 23:42:49 +03:00 by kerem · 13 comments
Owner

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?

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?
kerem 2026-02-25 23:42:49 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@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:

image

Does that help?

<!-- gh-comment-id:1380064911 --> @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: ![image](https://user-images.githubusercontent.com/661859/212033495-87e6fffe-f1c1-406f-882b-6b64bfb2e681.png) Does that help?
Author
Owner

@jeanpaulrh commented on GitHub (Jan 18, 2023):

Yes. Thank you. I missed it!

<!-- gh-comment-id:1386714338 --> @jeanpaulrh commented on GitHub (Jan 18, 2023): Yes. Thank you. I missed it!
Author
Owner

@SofianeHamlaoui commented on GitHub (Feb 15, 2023):

@cuu508 you think it'll be cool to have a percentage of failed & succeeded tasks ?

<!-- gh-comment-id:1431682837 --> @SofianeHamlaoui commented on GitHub (Feb 15, 2023): @cuu508 you think it'll be cool to have a percentage of failed & succeeded tasks ?
Author
Owner

@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?

<!-- gh-comment-id:1432569064 --> @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?
Author
Owner

@SofianeHamlaoui commented on GitHub (Feb 20, 2023):

@SofianeHamlaoui not sure, can you describe your idea a little more – how would be the percentage calculated, and where would it be displayed?

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.

<!-- gh-comment-id:1437334774 --> @SofianeHamlaoui commented on GitHub (Feb 20, 2023): > @SofianeHamlaoui not sure, can you describe your idea a little more – how would be the percentage calculated, and where would it be displayed? 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.
Author
Owner

@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?

<!-- gh-comment-id:1437353340 --> @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?
Author
Owner

@SofianeHamlaoui commented on GitHub (Feb 21, 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?

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.

<!-- gh-comment-id:1438107549 --> @SofianeHamlaoui commented on GitHub (Feb 21, 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? 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.
Author
Owner

@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:

image

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)"

<!-- gh-comment-id:1438132113 --> @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: ![image](https://user-images.githubusercontent.com/661859/220301242-ce489dd7-f61d-47b5-a80c-33be38148472.png) 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)"
Author
Owner

@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

<!-- gh-comment-id:1438197438 --> @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`
Author
Owner

@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)

<!-- gh-comment-id:1438241645 --> @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)
Author
Owner

@SofianeHamlaoui 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)

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.

<!-- gh-comment-id:1438478846 --> @SofianeHamlaoui 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) 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.
Author
Owner

@cuu508 commented on GitHub (Sep 28, 2023):

I've added uptime percentage display. Looks like so:

image

<!-- gh-comment-id:1738535937 --> @cuu508 commented on GitHub (Sep 28, 2023): I've added uptime percentage display. Looks like so: ![image](https://github.com/healthchecks/healthchecks/assets/661859/74550681-4770-4744-9fb6-9b2646aa9cd3)
Author
Owner

@SofianeHamlaoui commented on GitHub (Oct 10, 2023):

I've added uptime percentage display. Looks like so:

image

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 !

<!-- gh-comment-id:1755398431 --> @SofianeHamlaoui commented on GitHub (Oct 10, 2023): > I've added uptime percentage display. Looks like so: > > ![image](https://user-images.githubusercontent.com/661859/271190792-74550681-4770-4744-9fb6-9b2646aa9cd3.png) 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 !
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#543
No description provided.