metrics

package
v0.0.0-...-234d38c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetricKindRenovateJobsQueueLength ..
	MetricKindRenovateJobsQueueLength schemas.MetricKind = iota
)

List of all the metrics supported by this exporter

View Source
const (
	TaskTypePullMendRenovateStatus schemas.TaskType = "TaskTypePullMendRenovateStatus"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MendRenovateClient

type MendRenovateClient struct {
	URL   string
	Token string
}

MendRenovateClient can be used to call Mend Renovate instance

func (*MendRenovateClient) GetStatus

func (c *MendRenovateClient) GetStatus(ctx context.Context) (Status, error)

GetStatus call the status endpoint and collect the metrics

type MendRenovateController

type MendRenovateController struct {
	// Controller is the main controller handling scheduling
	Controller *controller.Controller
	// contains filtered or unexported fields
}

MendRenovateController is used to handle task scheduling

func NewMendRenovateController

func NewMendRenovateController(c *controller.Controller) *MendRenovateController

func (*MendRenovateController) Configure

func (c *MendRenovateController) Configure(ctx context.Context)

Configure set up the API metrics or sdk used to fetch the data.

func (*MendRenovateController) NewCollectors

NewCollectors returns a new collector for resource exposed for this controller.

type Status

type Status struct {
	BootDate time.Time `json:"bootDate"`
	Jobs     struct {
		LastEnqueueDate time.Time `json:"lastEnqueueDate"`
		LastJob         struct {
			InstallationID int `json:"installationId"`
			Params         struct {
			} `json:"params"`
			Priority   int    `json:"priority"`
			Reason     string `json:"reason"`
			Repository string `json:"repository"`
		} `json:"lastJob"`
		LastJobDispatchDate time.Time `json:"lastJobDispatchDate"`
		LastJobFinished     struct {
			Finished       time.Time `json:"finished"`
			InstallationID int       `json:"installationId"`
			Params         struct {
			} `json:"params"`
			Priority   int    `json:"priority"`
			Reason     string `json:"reason"`
			Repository string `json:"repository"`
		} `json:"lastJobFinished"`
		QueueLength        int `json:"queueLength"`
		TotalJobsProcessed int `json:"totalJobsProcessed"`
	} `json:"jobs"`
	JobsInProgress []struct {
		Repository string    `json:"repository"`
		Started    time.Time `json:"started"`
	} `json:"jobsInProgress"`
	Scheduler struct {
		Cron           string      `json:"cron"`
		LastScheduling interface{} `json:"lastScheduling"`
		Platform       string      `json:"platform"`
	} `json:"scheduler"`
	Webhooks struct {
		LastWebhookReceived time.Time `json:"lastWebhookReceived"`
	} `json:"webhooks"`
	Worker struct {
		CurrentJob struct {
			InstallationID int `json:"installationId"`
			Params         struct {
			} `json:"params"`
			Priority   int    `json:"priority"`
			Reason     string `json:"reason"`
			Repository string `json:"repository"`
		} `json:"currentJob"`
		CurrentJobStart time.Time `json:"currentJobStart"`
		PreviousJob     struct {
			InstallationID int `json:"installationId"`
			Params         struct {
			} `json:"params"`
			Priority   int    `json:"priority"`
			Reason     string `json:"reason"`
			Repository string `json:"repository"`
		} `json:"previousJob"`
		PreviousJobStart       time.Time `json:"previousJobStart"`
		RemediateServerEnabled bool      `json:"remediateServerEnabled"`
	} `json:"worker"`
}

Status is the raw response of the API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL