Skip to content

Commit 7afcd67

Browse files
committed
add comments
1 parent 41c3133 commit 7afcd67

9 files changed

+9
-1
lines changed

pkg/config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var (
1414
Debug bool
1515
)
1616

17-
// InitConfiguration => set configuration from env vars or command parameters
17+
// InitConfiguration - set configuration from env vars or command parameters
1818
func InitConfiguration() []cli.Flag {
1919
return []cli.Flag{
2020
&cli.IntFlag{

pkg/metrics/get_billable_from_github.go

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var (
2121
)
2222
)
2323

24+
// getBillableFromGithub - return billable informations for MACOS, WINDOWS and UBUNTU runners.
2425
func getBillableFromGithub() {
2526
for {
2627
for _, repo := range config.Github.Repositories.Value() {

pkg/metrics/get_runners_from_github.go

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var (
2121
)
2222
)
2323

24+
// getRunnersFromGithub - return information about runners and their status for a specific repo
2425
func getRunnersFromGithub() {
2526
for {
2627
for _, repo := range config.Github.Repositories.Value() {

pkg/metrics/get_runners_organization_from_github.go

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var (
2121
)
2222
)
2323

24+
// getRunnersOrganizationFromGithub - return information about runners and their status for an organization
2425
func getRunnersOrganizationFromGithub() {
2526
opt := &github.ListOptions{PerPage: 10}
2627
for {

pkg/metrics/get_workflow_runs_from_github.go

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ var (
3535
)
3636
)
3737

38+
// getWorkflowRunsFromGithub - return informations and status about a worflow
3839
func getWorkflowRunsFromGithub() {
3940
for {
4041
for _, repo := range config.Github.Repositories.Value() {

pkg/metrics/metrics.go

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var (
1616
err error
1717
)
1818

19+
// InitMetrics - register metrics in prometheus lib and start func for monitor
1920
func InitMetrics() {
2021
prometheus.MustRegister(runnersGauge)
2122
prometheus.MustRegister(runnersOrganizationGauge)

pkg/metrics/workflows_cache.go

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var (
1515
workflows map[string]map[int64]github.Workflow
1616
)
1717

18+
// workflowCache - used for limit calls to github api
1819
func workflowCache() {
1920
for {
2021
ww := make(map[string]map[int64]github.Workflow)

pkg/server/routes.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var (
1818
index = fasthttpadaptor.NewFastHTTPHandlerFunc(pprof.Index)
1919
)
2020

21+
// prometheusHandler - fastHTTP handler for prometheus metrics
2122
func prometheusHandler() fasthttp.RequestHandler {
2223
return fasthttpadaptor.NewFastHTTPHandler(promhttp.Handler())
2324
}

pkg/server/server.go

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github-actions-exporter/pkg/metrics"
1313
)
1414

15+
// RunServer - run http server for expose metrics
1516
func RunServer(ctx *cli.Context) error {
1617
metrics.InitMetrics()
1718

0 commit comments

Comments
 (0)