Skip to main content
Runtime counters are maintained in memory and periodically persisted. Use the Script counter functions for current values; querying the database alone can return an older value.

Read counters

Each persisted RuntimeCounter has ObjectId, Key, and Counter. List keys and fetch their live value:
If you query the collection name RuntimeCounters, quote it because the same name is also a .NET namespace:
Useful functions include GetCounter, GetCounters, IncCounter, DecCounter, and the counter flush function available in the installed build.

Compare snapshots

Create a dictionary keyed by counter name:
Take the second sample later and subtract the dictionaries:
Dictionary subtraction treats a missing key as the additive zero value, making it suitable when counters appear between samples.

Counter reports

The administrative Sources & Nodes view can expose file-based reports for labelled snapshots and comparisons. Standard reports include general counter comparison and a billable-counter view. Typical business counters include account creation, remote login, legal-identity states, contract/template states, and KYC provider operations. Treat the exact keys as versioned runtime output: discover them from the server instead of hard-coding an exhaustive list.

Reporting guidance

  • Record snapshot time, Neuron identity, build, and counter prefix.
  • Use monotonically increasing counters for rates by comparing two labelled snapshots.
  • Expect resets after database restoration or deliberate counter maintenance.
  • Do not use counters as a financial ledger; use auditable domain events for settlement.
  • Alert on rates and trends, not a single cumulative value.
See Reports and automation to turn these queries into reusable operator reports.