metrics

package
v0.0.0-...-7567ae8 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelError

type ChannelError chan error

ChannelError : channel to handle errors async

type Client

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

Client : struct for github client

func NewMetricsClient

func NewMetricsClient() Client

NewMetricsClient : initialize github metrics client

func (*Client) NewRepoMetrics

func (mc *Client) NewRepoMetrics(owner, name string) RepoMetrics

NewRepoMetrics : initialize user metrics given a owner and name

func (*Client) NewUserMetrics

func (mc *Client) NewUserMetrics(name string) UserMetrics

NewUserMetrics : initialize user metrics given a username

type IssuesFilter

type IssuesFilter struct {
	State   string   `json:"state"`
	Authors []string `json:"authors"`
	Labels  []string `json:"labels"`
}

IssuesFilter : filter for issues, leaving empty a value will be default as all

func (*IssuesFilter) Match

func (f *IssuesFilter) Match(issue *github.Issue) bool

Match : returns boolean for the match parametes

type RepoMetrics

type RepoMetrics struct {
	Name              string         `json:"name"`
	Owner             string         `json:"owner"`
	Stars             int            `json:"stars"`
	Forks             int            `json:"forks"`
	ContributorsCount int            `json:"contributors"`
	MainLanguage      string         `json:"main_language"`
	Languages         map[string]int `json:"languages"`
	Speed             float64        `json:"speed"`
	IssuesOpenCount   int            `json:"issues_open_count"`
	IssuesClosedCount int            `json:"issues_closed_count"`
	LastCommit        *github.Commit
	// contains filtered or unexported fields
}

RepoMetrics : struct for repository metrics

func (*RepoMetrics) FetchAllIssues

func (r *RepoMetrics) FetchAllIssues(opt *github.IssueListByRepoOptions) ([]*github.Issue, error)

FetchAllIssues : fetch all issues

func (*RepoMetrics) FetchContributorsCount

func (r *RepoMetrics) FetchContributorsCount() (int, error)

FetchContributorsCount : fetch form github the contributors count

func (*RepoMetrics) FetchLastCommit

func (r *RepoMetrics) FetchLastCommit() (*github.Commit, error)

FetchLastCommit : Fetch last commit from master

func (*RepoMetrics) FetchRepo

func (r *RepoMetrics) FetchRepo() error

FetchRepo : Fetch repo info

func (*RepoMetrics) FetchStats

func (r *RepoMetrics) FetchStats() map[int]map[int]*fastrends.TrendFloat64

FetchStats : fetch stats from closed issues in the project

func (*RepoMetrics) FetchStatsBy

func (r *RepoMetrics) FetchStatsBy(filter *IssuesFilter) map[int]map[int]*fastrends.TrendFloat64

FetchStatsBy : fetch stats from the filter pointer

func (*RepoMetrics) Issues

func (r *RepoMetrics) Issues() []*github.Issue

Issues : lazy load all repo issues

func (*RepoMetrics) IssuesClosed

func (r *RepoMetrics) IssuesClosed() []*github.Issue

IssuesClosed : fetch all closed issues return the trends map per year and week

func (*RepoMetrics) IssuesFiltered

func (r *RepoMetrics) IssuesFiltered(filter *IssuesFilter) []*github.Issue

IssuesFiltered : filter from fetched issues

func (*RepoMetrics) IssuesOpen

func (r *RepoMetrics) IssuesOpen() []*github.Issue

IssuesOpen : fetch all open issues and count total

type UserMetrics

type UserMetrics struct {
	Username     string         `json:"username"`
	Name         string         `json:"name"`
	Email        string         `json:"email"`
	Location     string         `json:"location"`
	Stars        int            `json:"stars"`
	Followers    int            `json:"followers"`
	AutoredRepos int            `json:"authored_repos"`
	Languages    map[string]int `json:"languages"`
	// contains filtered or unexported fields
}

UserMetrics : struct for github user metrics

func (*UserMetrics) FetchLanguagesCount

func (um *UserMetrics) FetchLanguagesCount(detail bool) (map[string]int, error)

FetchLanguagesCount : count languages lines of code

func (*UserMetrics) FetchProfile

func (um *UserMetrics) FetchProfile() error

FetchProfile : load user profile info

func (*UserMetrics) InitReposMetrics

func (m *UserMetrics) InitReposMetrics() error

InitReposMetrics : initialize user repositories

Jump to

Keyboard shortcuts

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