Documentation
¶
Overview ¶
Package record turns a judge's seat scores into the two records an install keeps of them: additive cells in a tally sheet on disk, and one row per score in an outbox.
THE MECHANISM. Recorder.Record takes the scores judge.Judge answered and does two things with them. Every valid one is observed into the sheet the recorder holds, under the role_quality metric the crew picker reads seat quality from, and one row is appended to the recorder's outbox when it holds one. A score whose role is not one of the judged seats, or that is not on the 0-100 scale, is skipped and named in the error; the others are recorded however the round went, and the sheet is observed whatever the outbox does. A nil outbox records locally only.
The sheet an install keeps of its own scores is its own evidence: it is saved under the pool directory (OwnSheetName) and read back as the cells the crew picker's prior blends in beside an index's (Cells).
Index ¶
Constants ¶
const Metric = "role_quality"
Metric is the sheet metric a judged seat score is observed under: the word the crew picker reads a measured seat quality from.
const OwnSheetName = "own.json"
OwnSheetName is the file the install's own sheet is kept as, under the pool directory.
Variables ¶
This section is empty.
Functions ¶
func Cells ¶
Cells reads the sheet's own role_quality cells — the ones recorded with no dim labels — as the cells a prior reads: the seat, the model, the mean of the scores and the count behind them, sorted by seat then model, so the answer is a property of the sheet and never of the order it was observed in. A nil sheet answers no cells.
func LoadSheet ¶
LoadSheet reads the sheet at path. A path with no file answers an empty sheet and no error — an install that has recorded nothing yet is not a fault; bytes that are there and do not parse as a sheet document are.
func OwnSheetPath ¶
OwnSheetPath is where the install's own sheet lives for the pool directory given.
Types ¶
type Recorder ¶
type Recorder struct {
// Sheet holds the install's own tallies; a recorder without one has
// nowhere to put what it is given, and refuses.
Sheet *tally.Sheet
// Outbox is the rows' way out. A nil Outbox keeps the scores locally
// only.
Outbox *outbox.Outbox
}
Recorder turns judge scores into the two records an install keeps: the sheet observed locally and, when one is held, the outbox rows that leave.
func (*Recorder) Record ¶
Record observes every score it is given into the sheet, and appends one row per score to the outbox when the recorder holds one. THE SHEET IS OBSERVED WHATEVER THE OUTBOX DOES: every score is observed before the first row is appended, so an append that fails costs the install nothing of its own evidence, and the first append error is returned once every score has been observed. A score whose role is not one of the judged seats, or whose score is not on the 0-100 scale, is skipped and named in the error beside the others that were recorded.
type Row ¶
type Row struct {
Schema int `json:"schema"`
Metric string `json:"metric"`
Role string `json:"role"`
Model string `json:"model"`
Score float64 `json:"score"`
Judge string `json:"judge"`
Door string `json:"door"`
Size string `json:"size"`
Day string `json:"day"`
}
Row is one judged seat score as it leaves the install: what was scored — the metric, the seat and the model that held it, the score on the 0-100 scale — and the facts of the run it was read from, the judge that answered, the door the run came in by (task, do, exec or run), the size of the crew, and the day.