Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/metrics/get_billable_from_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var (
// getBillableFromGithub - return billable informations for MACOS, WINDOWS and UBUNTU runners.
func getBillableFromGithub() {
for {
workflowBillGauge.Reset()

for _, repo := range repositories {
for k, v := range workflows[repo] {
r := strings.Split(repo, "/")
Expand Down
2 changes: 2 additions & 0 deletions pkg/metrics/get_runners_from_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func getAllRepoRunners(owner string, repo string) []*github.Runner {
// getRunnersFromGithub - return information about runners and their status for a specific repo
func getRunnersFromGithub() {
for {
runnersGauge.Reset()

for _, repo := range repositories {
r := strings.Split(repo, "/")

Expand Down
3 changes: 3 additions & 0 deletions pkg/metrics/get_workflow_runs_from_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ func getRunUsage(owner string, repo string, runId int64) *github.WorkflowRunUsag
// getWorkflowRunsFromGithub - return informations and status about a workflow
func getWorkflowRunsFromGithub() {
for {
workflowRunStatusGauge.Reset()
workflowRunDurationGauge.Reset()

for _, repo := range repositories {
r := strings.Split(repo, "/")
runs := getRecentWorkflowRuns(r[0], r[1])
Expand Down
6 changes: 4 additions & 2 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package server

import (
"log"
"net"
"strconv"

"github.com/fasthttp/router"
Expand Down Expand Up @@ -30,6 +31,7 @@ func RunServer(ctx *cli.Context) error {
r.GET("/debug/pprof/{profile}", pprofHandlerIndex)
}

log.Print("exporter listening on 0.0.0.0:" + strconv.Itoa(config.Port))
return fasthttp.ListenAndServe(":"+strconv.Itoa(config.Port), r.Handler)
log.Print("exporter listening on 0.0.0.0::" + strconv.Itoa(config.Port))
ln, _ := net.Listen("tcp", ":"+strconv.Itoa(config.Port))
return fasthttp.Serve(ln, r.Handler)
}