score

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package score はベンチマークのスコアを収集グループ(GroupId)に紐づけて保存する。

スコアはベンチ実行スクリプトの標準出力にしか無く、計測結果と機械的に繋がっていなかった。 スコアを1つの snapshot として持たせることで、収集一覧・グラフ・CLI から 「この収集はスコアいくつの走行か」を引けるようにする。

スコアの見方は回ごとに違うので、数値1本(Score)に加えてベンチの生出力(Raw)も保持する。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(opts *collect.Options) *handler

Types

type Value

type Value struct {
	// Score はスコア。回によらず「大きいほど良い」1本の数値。
	Score int64
	// Passed はベンチが成功したか。整合性チェック落ちなど、失敗した走行も記録する。
	Passed bool
	// Target は走行の対象(ホスト名など)。
	Target string
	// ErrorCount はベンチが報告したエラー件数。
	ErrorCount int
	// StartedAt / FinishedAt は走行区間。他の計測と突き合わせるのに使う。
	StartedAt  time.Time
	FinishedAt time.Time
	// Raw はベンチの生出力。回ごとに違う減点内訳などを後から読めるようにしておく。
	Raw string
}

Value は1回の走行の結果。snapshot の本体としてこの JSON が保存される。

func (*Value) Duration

func (v *Value) Duration() time.Duration

Duration は走行時間。開始か終了が空なら 0。

func (*Value) Summary

func (v *Value) Summary() string

Summary は収集一覧やイベントに出す1行の要約。

Jump to

Keyboard shortcuts

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