Aggregations

Count anything, per anything, over any window.

Counts, sums, minimums and maximums, distinct values, first and last, percentiles. Per user, account, device, meter or order, over the last few minutes, this month or a whole lifetime. Described as configuration, kept current as every event arrives.

One account's eventsLive
Rolling · last 6 hours7
Calendar · today11
Lifetime1,264
One stream of events, three windows over it. Illustrative.
Operations

Nine ways to keep a number

Pick what to keep and from which events. The same operations serve every field: a few examples below.

  • Count

    How many events happened.

    SaaSAPI calls per key, this minute
  • Sum

    The total of a value, exact to the last decimal.

    EnergyKilowatt-hours per meter, this month
  • Minimum and maximum

    The smallest or the largest value.

    BankingLargest transfer per account, last 48 hours
  • Happened within

    Whether something happened at all.

    GamingBonus granted to this player in the last 7 days?
  • Distinct values

    How many different values: estimated, or exact up to 10,000.

    MediaDifferent titles watched per profile, this week
  • First and last

    The earliest or latest value, or when it happened.

    MobilityLast charging station per vehicle, and when
  • Percentiles

    A distribution, read as the percentile you ask for.

    Logistics95th percentile delivery time per region
  • Filters

    Count only what matches: an amount, a status, a code.

    ManufacturingReadings above 80 °C per machine, last hour
Windows

Rolling, calendar, lifetime, and more

One total answers over many windows. Pick one and see which of a shopper's orders it reads, and what it answers.

One shopper's orders, over 18 days

Orders in the last 7 days

Moves with the clock. Add an offset to compare with the same span earlier, as a baseline.

8 orders362.94 EUR
Definition{"rolling": "7d"}
Per anything

Keep numbers per anything you track

A user, an account, a device, a meter, an order: you name the kinds of things you track, and each one appears the moment an event mentions it. One event updates the numbers of everything it names.

  • Variants of one id count as one: emails, IP addresses, phone numbers
  • Attributes hold what events don't carry: a plan, a credit limit, a time zone
  • Combinations as keys: this user on this device, this card at this shop
  • Up to 16 things per event, all updated at once
Anything you track
  • User
  • Account
  • Device
  • Card
  • Meter
  • Vehicle
  • Player
  • API key
  • IP address
  • Order
Variants of one id count as one
  • " Alice@Example.COM "emailalice@example.com
  • ::ffff:203.0.113.7ip203.0.113.7
  • +49 30 1234567phone+49301234567
Per combination
userdeviceSign-ins of this user on this device14
Relationships

One event counts for the user, their team and their company

Link what belongs together, and a total rolls up the chain as each event arrives. A question about a user can read their company's number too.

  • Roll-ups up to 3 levels: user, team, company; device, site, region
  • Every level on the way is updated, not only the top
  • Counted where it happened: someone who changes teams takes only future events along
  • No link, no guess: the value is reported as missing, never as 0
API calls · this hour
CompanyAcme150TeamPayments69TeamPlatform81Useralice42Userbob27Userchen63Userdana18API call

Same idea:device → site → regionstore → city → country

Exact numbers and money

Exact to the cent. A USD order never inflates a EUR total.

Amounts are kept as exact decimals, never as floating point, and come back as strings like "559.90". Money totals know their currency.

  • A scale per currency: no decimals for JPY, 2 for EUR, 3 for BHD
  • Amounts with too many decimals are refused, or rounded half to even if you choose
  • One currency per total, or one total per currency, picked when you ask
  • Totals converted at the rates you keep; a missing rate is reported, never guessed
Order total · EUR only
  • 19.90 EURCounted
  • 25.00 USDOther currency: not in this total
  • 540.00 EURCounted
  • 12.345 EURToo many decimals: refused
Total, exact"559.90"
A scale per currency
  • JPYdecimal(0)1250
  • EURdecimal(2)19.90
  • BHDdecimal(3)4.125
Short and long windows

The last 15 minutes and the last 12 months, from one definition

A total can keep up to three resolutions at once. Every event updates each of them, and every question reads the one that fits its window, so short and long windows both stay lean.

  • Up to 3 resolutions per total, finest first
  • Kept for up to 400 days
  • Every window is checked against its total, with a memory estimate, before anything goes live
Questions
  • Last 15 minutesreads 1-minute buckets
  • Last 30 daysreads 1-hour buckets
  • Last 12 monthsreads 1-day buckets
One total, three resolutions
  1. 1-minute bucketskept 2 hours
  2. 1-hour bucketskept 70 days
  3. 1-day bucketskept 400 days
Configured, not coded

A total and a metric, as JSON or in a guided form

Define what to keep once, then ask about it over any window. Every definition is versioned: validate it, fill it with history and roll it out without a deploy.

POST /v1/admin/states
{
  "name": "spend_by_customer",
  "description": "Order amounts per customer, EUR only",
  "spec": {
    "on": "order_placed",
    "key": ["customer"],
    "op": "sum",
    "value": "attrs.amount",
    "valueType": "decimal(2)",
    "money": true,
    "currency": { "only": "EUR" },
    "tiers": [
      { "resolution": "1m", "retention": "2h" },
      { "resolution": "1h", "retention": "70d" },
      { "resolution": "24h", "retention": "400d" }
    ],
    "lifetime": true
  }
}
The same definitions in the workspace's guided form, with the JSON one click away.
Bounds

Key bounds

What a total, a window and an event can hold. Fixed by the engine, the same for every workspace.

Rolling windows15 to 1,440 bucketsAt 1-minute buckets: 15 minutes to 24 hours
Calendar windowsDay, week, month or yearUp to 12 periods back, up to 31 at once, any time zone
RetentionUp to 400 days per total
Resolutions per totalUp to 3Up to 10,080 buckets each
Things per eventUp to 16
Kinds of things in one keyUp to 3
Roll-ups and pathsUp to 3 levelsFan-out up to 100, up to 256 things reached per event
Exact distinct valuesUp to 10,000 per setDefault 1,000; otherwise estimated
Decimal scale0 to 9 decimals
Percentile binsUp to 15 bounds
Events per batchUp to 500
Get started

Put a live number on anything

Request access and tell us what you want to count.