exporter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// save github data for api limit.
	Kv *cache.Cache
)

Functions

func NewDevCollector

func NewDevCollector(gs []*GitHubCollector) prometheus.Collector

func NewGitHubClient

func NewGitHubClient(ctx context.Context) (*github.Client, error)

NewGitHubClient constructor

func RecordMetrics

func RecordMetrics(gs []*GitHubCollector)

Types

type Dispatcher

type Dispatcher struct {
	// contains filtered or unexported fields
}

func NewDispatcher

func NewDispatcher(worker Worker) *Dispatcher

func (*Dispatcher) Add

func (d *Dispatcher) Add(job *Job)

func (*Dispatcher) Start

func (d *Dispatcher) Start(ctx context.Context)

func (*Dispatcher) Stop

func (d *Dispatcher) Stop()

func (*Dispatcher) Wait

func (d *Dispatcher) Wait()

type GitHubCollector

type GitHubCollector struct {
	// contains filtered or unexported fields
}

func NewGitHubCollector

func NewGitHubCollector(org string) *GitHubCollector

func (*GitHubCollector) GetIssuesByRepo

func (g *GitHubCollector) GetIssuesByRepo(repoName string) ([]*github.Issue, error)

func (*GitHubCollector) GetOrg

func (g *GitHubCollector) GetOrg() (*github.Organization, error)

func (*GitHubCollector) GetPullRequestsByRepo

func (g *GitHubCollector) GetPullRequestsByRepo(repoName string) ([]*github.PullRequest, error)

func (*GitHubCollector) GetReposByOrg

func (g *GitHubCollector) GetReposByOrg() ([]*github.Repository, error)

type Job

type Job struct {
	// contains filtered or unexported fields
}

func NewJob

func NewJob(client *github.Client, orgName string) *Job

func (*Job) Execute

func (j *Job) Execute(ctx context.Context) error

type Worker

type Worker interface {
	Work(ctx context.Context, job *Job)
}

func NewWorker

func NewWorker() Worker

Jump to

Keyboard shortcuts

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