metering

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package metering contains a bounded family-level contract test for provider normalizers and the shared V2 reducer. It intentionally does not enumerate frontend-by-backend combinations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, env Env)

Run exercises exact partitioning, unknown/presence retention, native multimodal direction/unit identity, namespaced resources and aggregate coverage. The fixtures are synthetic; only a test-side exact oracle checks the documented 11.6 partition and production code does not calculate price.

Types

type Env

type Env struct {
	Normalize func(normalize.Input) (normalize.Result, error)
	Reduce    func([]sdkmetering.Observation) (aggregate.SnapshotV2, error)
}

Env supplies the actual family normalizer and the shared reducer under test. A provider-family adapter can reuse Run by adapting its local decoded fields into normalize.Input; no provider SDK type enters this contract package.

Jump to

Keyboard shortcuts

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