Skip to content

Commit

Permalink
Merge pull request #1 from userbradley/feature/down-latency-to-0ms
Browse files Browse the repository at this point in the history
Fixing latency when app is down
  • Loading branch information
userbradley authored Aug 21, 2023
2 parents 94f7392 + 862c14d commit 8efd9fb
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/bumpr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Create Tag & Release
on:
push:
branches:
- main
pull_request:
types:
- labeled

permissions:
pull-requests: write
contents: write

jobs:
comment-pr:
if: github.event.action == 'labeled'
runs-on: ubuntu-latest
name: Comment on PR the version to be released
steps:
- uses: actions/checkout@v2
- name: Post bumpr status comment
uses: haya14busa/action-bumpr@v1
create-tag-and-release:
if: github.event.action != 'labeled'
runs-on: ubuntu-latest
name: Bump tag and cut release
steps:
- uses: actions/checkout@v3

- name: Bumpr Create Tag
id: bumpr
if: "!startsWith(github.ref, 'refs/tags/')"
uses: haya14busa/action-bumpr@v1

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.bumpr.outputs.next_version }}
name: Version ${{ steps.bumpr.outputs.next_version }}
generate_release_notes: true
draft: false
prerelease: false
1 change: 1 addition & 0 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func checkEndpoint(endpoint *EndpointCheck, stopChan <-chan struct{}) {
if err != nil {
fmt.Printf("Error checking %s: %v\n", endpoint.Name, err)
statusGauge.WithLabelValues(endpoint.Name).Set(0)
latencyGauge.WithLabelValues(endpoint.Name).Set(0) // Set latency to 0 on error
} else {
resp.Body.Close()
fmt.Printf("%s: Latency: %dms\n", endpoint.Name, latency)
Expand Down

0 comments on commit 8efd9fb

Please sign in to comment.