stats

package
v0.0.0-...-11fe650 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Average

func Average(xs []float64) float64

Average returns the average of the given floats.

func Std

func Std(xs []float64) float64

Std returns the standard deviation of the given floats.

Types

type DataPoint

type DataPoint struct {
	Value float64
	Date  *time.Time `json:",omitempty"`
	PRs   []int      `json:",omitempty"`
}

type Handler

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

func NewHandler

func NewHandler(ho *HandlerOptions) *Handler

func (*Handler) Run

func (h *Handler) Run() (*Results, error)

type HandlerOptions

type HandlerOptions struct {
	Mq       *mergequeue.Handler
	Co       *chatops.Handler
	Source   string
	EndDate  time.Time
	DataDays int

	TargetMetrics []types.Metric
}

type Results

type Results struct {
	EndDate  string
	DataDays int
	Source   string
	Data     map[string]RunningAverageDataItem
}

Results represents the data obtained from GitHub. It includes the source repo from which the data was obtained and the number of days back from the execution time included in the data.

type RunningAverageDataItem

type RunningAverageDataItem struct {
	Avg        float64
	Std        float64
	DataPoints []DataPoint
}

RunningAverageDataItem contains data information in the form of a running average. It contains the actual average value and the data points used to obtain it.

func (*RunningAverageDataItem) String

func (d *RunningAverageDataItem) String() string

Jump to

Keyboard shortcuts

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