App Usage Metering
How IronFlock tracks and measures app usage for billing.
Overview
IronFlock continuously meters the usage of every app running in the system. This metering data feeds into the monthly billing cycle to calculate how much each customer owes for third-party app usage.
Metering runs automatically in the background. As an app distributor, you don’t need to instrument your app — IronFlock handles all tracking.
What Gets Metered
App-Days
An app-day is the fundamental billing unit for third-party apps. It represents one device using your app for one day.
- If a customer adds 5 devices to your app and uses it for 30 days, that’s 150 app-days.
- App-days are tracked per device, per app, and aggregated into the customer’s monthly bill.
- Only apps in PROD mode are metered. Apps running in DEV mode (during development and testing) are not billed.
App-days are the only metric that drives third-party app billing. Network traffic, storage, and other infrastructure resources are metered separately as part of infrastructure billing and do not affect the app distributor’s revenue.
How Metering Works
Data Collection
Usage data is collected from device agent reports with hourly granularity per device.
Aggregation
Raw metering data is stored in time-series tables (powered by TimescaleDB) and aggregated into billable amounts:
- Hourly aggregation — Raw telemetry is rolled up into hourly summaries per device and per app.
- Monthly aggregation — Hourly data is summed into monthly totals for each customer.
- Bill calculation — Monthly totals are compared against the product’s included units, and the rebate formula is applied to determine the final billable amount.
DEV vs. PROD Mode
IronFlock distinguishes between development and production usage:
| Mode | Usage Tracked | Billed |
|---|---|---|
| DEV | Yes | No — free for testing |
| PROD | Yes | Yes — billed per product pricing |
Only PROD mode usage generates bills. Customers can test your app in DEV mode without incurring charges.
Infrastructure vs. App Metering
IronFlock maintains two separate metering streams:
Infrastructure Resource Metering
Tracks usage of IronFlock’s own infrastructure — storage, network traffic, virtual devices, and AI tokens. This is billed by IronFlock to the customer directly and does not involve the app distributor.
Third-Party App Metering
Tracks usage of apps published by distributors. The billing system creates separate billing records per distributor — if a customer uses apps from multiple distributors, each distributor’s apps are billed independently. This enables Stripe destination charges to route the correct share to each distributor’s connected account.