Documentation
¶
Overview ¶
Package stats rolls the human gate up across runs: what the agent filed, what was published, what the human rejected and what the agent cut itself, counted the way the published loupe-meta marker counts them.
Index ¶
Constants ¶
const ( StateCaptured = "captured" StateReady = "ready" StatePublished = "published" )
const ( GroupNone = "none" GroupRepo = "repo" GroupWeek = "week" GroupMonth = "month" )
Variables ¶
var GroupBys = []string{GroupNone, GroupRepo, GroupWeek, GroupMonth}
var States = []string{StateCaptured, StateReady, StatePublished}
States is every state in the order a filter echoes them.
Functions ¶
Types ¶
type ByLabel ¶
type ByLabel struct {
Published LabelCounts `json:"published"`
Excluded LabelCounts `json:"excluded"`
}
type Duration ¶
Duration is an ISO 8601 duration in whole seconds, in hours, minutes and seconds only, since a day there is a calendar day rather than 24 hours.
func (Duration) MarshalJSON ¶
type Findings ¶
type Findings struct {
Filed int `json:"filed"`
Published int `json:"published"`
Excluded int `json:"excluded"`
Withdrawn int `json:"withdrawn"`
Pending int `json:"pending"`
Reinstated int `json:"reinstated"`
Regraded int `json:"regraded"`
}
Findings splits Filed into Published, Excluded, Withdrawn and Pending. Reinstated and Regraded are flags that can overlap any of them.
type Gate ¶
type Gate struct {
Published, Gated int
}
Gate is precision's dividend and divisor: published, and published plus excluded, over attended published runs.
type Group ¶
type Group struct {
Key string `json:"key"`
Runs Runs `json:"runs"`
PullRequests int `json:"pullRequests"`
Findings Findings `json:"findings"`
ByLabel ByLabel `json:"byLabel"`
Blocking Blocking `json:"blocking"`
// Precision and MedianCaptureToPublish are over attended published runs only, nil when there is nothing to divide.
Precision *float64 `json:"precision"`
Drifted []string `json:"drifted"`
MedianCaptureToPublish *Duration `json:"medianCaptureToPublish"`
// Gate stays out of the JSON, which carries only the ratio; the human output prints it beside precision.
Gate Gate `json:"-"`
}