← ERP rendszer építők adatlapja

Skill · 1.0.0 verzió

Használatmérés ellenőrzése

Összegmegmaradást, pontos felhalmozást, duplikációkezelést és történeti árakat tesztel a használatelszámolásban.

metering-verification

Ezt a skillt használó csapattagok

Nézd meg, miben segít

Mikor hasznos?

Akkor használd, ha mért költség vagy kvóta határozza meg az ügyfél egyenlegét.

Miben segít neked?

  • Ellenőrzi, hogy a részletezések összege egyezzen a naplóval.
  • Vizsgálja, hogy ismételt és pontosított esemény ne számolódjon kétszer.
  • Teszteli az árhatárokat és szolgáltatóspecifikus mennyiségeket.

Például ezt kérheted

Ellenőrizd az apró tokendíjakat, dupla streameseményeket és becsléspontosítást történeti újraárazás nélkül. Az új árat csak későbbi használatra alkalmazd, majd egyeztesd a jelentést. A régi elszámolás maradjon változatlan, az ismételt bizonyíték ne jelentsen új díjat.

Részletes dokumentáció

Itt a skill eredeti útmutatóját, példáit és ellenőrzési szempontjait olvashatod az eredeti nyelven.

Részletek…Összecsukás

Metering Verification

A metering bug silently corrupts financial visibility, unit economics, or customer quota enforcement. Every metering pipeline, price calculator, and attribution query must be verified with deterministic tests covering edge cases and failure modes.

Workflow

  1. Verify accounting invariants and conservation laws:
    • Assert that the sum of drill-down slices across any dimension (SUM(cost) GROUP BY tenant_id, GROUP BY agent_role, GROUP BY model) equals the grand total ledger cost (100% conservation, zero dropped or duplicated rows from join fan-out).
    • Assert sub-cent precision: verify that 100,000 micro-events of 10 cached tokens each accumulate to the exact expected microdollar total with zero floating-point drift.
  2. Test deduplication and out-of-order ingestion:
    • Replay the exact same usage event payload 5 times (and under concurrent workers) and assert that ledger count and total quantity increase only once.
    • Test upgrade transitions: ingesting an 'estimated' event followed by a 'provider_reported' event with the same idempotencyKey must supersede or adjust the estimate without double-counting.
  3. Test rate card boundaries and version transitions:
    • Test events with occurredAt 1 ms before effectiveFrom, at effectiveFrom, and 1 ms after effectiveTo.
    • Verify that inserting a new price version does not alter the computed cost of historical events unless an explicit repricing command is run.
  4. Test provider-specific LLM usage normalization:
    • Include fixtures for OpenAI (cached_tokens inside prompt_tokens, reasoning_tokens inside completion_tokens), Anthropic (input_tokens disjoint from cache_creation_input_tokens and cache_read_input_tokens), and Gemini (cachedContentTokenCount inside promptTokenCount, thoughtsTokenCount).
    • Verify that normalized billable buckets never double-charge cached or reasoning tokens.
  5. Test failure, timeout, and reservation lifecycle:
    • Verify that failed upstream calls that consumed tokens still emit usage events.
    • Verify that pre-execution budget reservations (reserve -> settle -> release or expire) never leak locked quota under concurrency.

Verification Checklist

  • Idempotent replay of identical events produces zero duplicate ledger entries.
  • Sub-cent microdollar / nanodollar arithmetic matches exact reference calculations.
  • Provider token fixtures (OpenAI, Anthropic, Gemini) normalize without double-counting.
  • Historical queries use occurredAt rate versions and remain invariant when today's prices change.
  • Sum of tenant + system buckets equals total ingested cost with no join fan-out.

Csomagban lévő fájlok 1

  • SKILL.md