uptime-kuma icon indicating copy to clipboard operation
uptime-kuma copied to clipboard

Fixed the metrics for the push type.

Open RubenNL opened this issue 2 years ago • 4 comments

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules: https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma

Tick the checkbox if you understand [x]:

  • [X] I have read and understand the pull request rules.

Description

Fixes part of #1474.

Currently, the push metrics are only updated when they "expire". This is fixed with this small change.

Type of change

Please delete any options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I ran ESLint and other linters for modified files
  • [x] I have performed a self-review of my own code and tested it
  • [ ] I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods)
  • [x] My changes generate no new warnings
  • [ ] My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.

RubenNL avatar Dec 28 '22 09:12 RubenNL

You can also fix the response time display by changing line 40:

        let ping = parseInt(request.query.ping) || null;

chakflying avatar Jan 04 '23 08:01 chakflying

You can also fix the response time display by changing line 40:

        let ping = parseInt(request.query.ping) || null;

I'm trying to understand what this would do, because I don't have any errors now. The ping is reported as -1 in /metrics, which seems to be as expected?

RubenNL avatar Jan 11 '23 17:01 RubenNL

When I tried to send the ping with push parameters ?ping=100 it didn't update in the metrics. I guess if you don't use it you can ignore this.

chakflying avatar Jan 11 '23 18:01 chakflying

Good catch, I will try that later this week and add it to the pull request.

RubenNL avatar Jan 11 '23 19:01 RubenNL