scenario

package
v0.0.0-...-53f8b62 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PostValidation

func PostValidation(ctx context.Context, target string, addr string) error

Types

type Scenario

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

Scenario はシナリオを表す構造体 以下の関数を実装して b.AddScenario() で追加したあと b.Run() で実行される - Prepare(context.Context, *BenchmarkStep) error

  • シナリオの初期化処理を行う
  • Initialize した後に Validation を呼ぶことが多いっぽい
  • Initialize -> Validation -> Initialize してもいいかも?(13とかはそうしてそう)

- Load(context.Context, *BenchmarkStep) error

  • シナリオのメイン処理を行う

- Validation(context.Context, *BenchmarkStep) error

  • シナリオの結果検証処理を行う
  • 料金の整合性をみたいかも

func NewScenario

func NewScenario(target, addr, paymentURL string, paymentBindPort int, logger *slog.Logger, reporter benchrun.Reporter, meter metric.Meter, prepareOnly bool, skipStaticFileSanityCheck bool) *Scenario

func (*Scenario) Load

func (s *Scenario) Load(ctx context.Context, step *isucandar.BenchmarkStep) error

Load はシナリオのメイン処理を行う

func (*Scenario) Prepare

func (s *Scenario) Prepare(ctx context.Context, step *isucandar.BenchmarkStep) error

Prepare はシナリオの初期化処理を行う

func (*Scenario) Score

func (s *Scenario) Score(final bool) int64

func (*Scenario) TotalDiscount

func (s *Scenario) TotalDiscount() int64

func (*Scenario) TotalSales

func (s *Scenario) TotalSales() int64

func (*Scenario) Validation

func (s *Scenario) Validation(ctx context.Context, step *isucandar.BenchmarkStep) error

Validation はシナリオの結果検証処理を行う

type ValidateData

type ValidateData struct {
	// 01JDFEDF00B09BNMV8MP0RB34G,匠椅子製作所,0811617de5c97aea5ddb433f085c3d1ef2598ab71531ab3492ebb8629f0598d2,cd8a581e44c8cc269ce9f1484b96f5346258d3790eab576c224e3b347f852245,2024-11-24 16:00:00.000000,2024-11-24 16:00:00.000000
	Owner01JDFEDF00B09BNMV8MP0RB34G struct {
		Sales                             api.OwnerGetSalesOK
		Sales1732579200000to1732622400000 api.OwnerGetSalesOK
		Chairs                            api.OwnerGetChairsOK
	}
	// 01JDM0N9W89PK57C7XEVGD5C80,Runolfsdottir6120,冬深,宇野,1978-01-20,21e9562de048ee9b34da840296509fa913bc34d804b3aab4dc4db77f3f6995e4,775a18ee413f42da826c77e8a85244,2024-11-26 10:35:49.000000,2024-11-26 10:35:49.000000
	User01JDM0N9W89PK57C7XEVGD5C80 struct {
		Rides api.AppGetRidesOK
	}
	// 01JDK5EFNGT8ZHMTQXQ4BNH8NQ,Block5589,良太,森田,1963-12-10,c9e15fd57545f43105ace9088f1c467eb3ddd232b49ac1ce6b6c52f5fb4d59e3,04d0b8f306231f6a63dc9164d4ce04,2024-11-26 02:40:14.000000,2024-11-26 02:40:14.000000
	User01JDK5EFNGT8ZHMTQXQ4BNH8NQ struct {
		Rides            api.AppGetRidesOK
		Estimated_3_10   api.AppPostRidesEstimatedFareOK
		Estimated_m11_10 api.AppPostRidesEstimatedFareOK
	}
	// 01JDJ4XN10E2CRZ37RNZ5GAFW6,Sauer4603,宇里,早川,1961-04-06,a8b21d78f143c3facdece4dffba964cc5120a341e383b1077e308be5cc67a8eb,e9620e1cf137d538374a96a2c1054d,2024-11-25 17:11:48.000000,2024-11-25 17:11:48.000000
	User01JDJ4XN10E2CRZ37RNZ5GAFW6 struct {
		Rides            api.AppGetRidesOK
		Estimated_3_10   api.AppPostRidesEstimatedFareOK
		Estimated_m11_10 api.AppPostRidesEstimatedFareOK
	}
}

func LoadData

func LoadData() *ValidateData

Directories

Path Synopsis
agents

Jump to

Keyboard shortcuts

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