Documentation
¶
Overview ¶
Package control holds the knobs of the mocks per tenant, for the slots of the benchmark.
Slots share one mock-1c and one mock-wms and tell their rows apart by tenant id. A knob set for a tenant (POST /control with a tenant_id) applies only to the requests of that tenant and wins over the process-wide value from the environment; DELETE /control/{tenant_id} puts the tenant back. Only the stand's own addresses (loopback and private networks) may call the routes.
Input: JSON {"tenant_id": "...", "fail_after_commit_rate": 0..1, "latency_ms": n, "reject_ref_prefix": "...", "ship_qty_factor": "1.5"}; every knob is optional, a missing one is left as it was. Output: the knobs of the tenant as JSON, with the same names.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Knobs ¶
type Knobs struct {
FailAfterCommitRate *float64 `json:"fail_after_commit_rate,omitempty"`
LatencyMS *int `json:"latency_ms,omitempty"`
RejectRefPrefix *string `json:"reject_ref_prefix,omitempty"`
ShipQtyFactor *string `json:"ship_qty_factor,omitempty"`
}
Knobs are the optional overrides of one tenant. A nil field means "not overridden".
func (Knobs) Factor ¶
Factor returns the shipped-quantity factor for a tenant, or def when not overridden.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store keeps the knobs of the tenants. The zero value is not usable; call New.