Resource time: preserve the unit before multiplying a rate
Translate allocation lifetimes into resource-time and hypothetical billable units without confusing wall time, kernel activity, and invoice quantities.
On this page
The question for today
What you’ll understand
- Integrate resource count over an explicitly defined interval.
- Apply a fictional minimum and rounding rule at the correct allocation boundary.
- Reconcile usage quantity, pricing unit, and charge type.
A ten-minute job can consume forty device-minutes, spend only part of them in kernels, and produce another quantity on an invoice. Those measurements answer different questions. Before comparing AI systems, preserve resource identity, allocation lifetime, and the unit attached to every quantity. All prices in this lesson are explicitly fictional, stable teaching inputs expressed in fictional credits, FC. They are not vendor quotes. Actual billing exports demonstrate why usage units and pricing units must be inspected separately; their schemas do not imply that our illustrative rounding policy applies to any particular service.
Integrate allocated resources over time
Resource-time counts simultaneous allocations rather than elapsed job duration alone. Four devices held for one hour contribute four device-hours even if their kernels run for only half that hour. Include setup, loading, evaluation, and idle residence when the chosen accounting boundary holds those devices throughout. An autoscaled job needs the integral of its changing resource count, or a sum over intervals with constant counts. Keep CPU core-hours, device-hours, memory-capacity time, and storage-capacity time separate until an explicit conversion or rate justifies combining them.
Use event timestamps from the allocation lifecycle and document whether intervals include their start and exclude their end. Overlapping worker logs must not count one shared allocation repeatedly. Conversely, summing job wall times can miss simultaneously allocated devices. Kernel utilization helps explain why allocated capacity produced little useful work, but it does not replace the allocation inventory. Retain both measurements with their identities and clocks so an apparent optimization can be traced to shorter residence, fewer devices, more useful execution, or merely a changed boundary.
Apply the policy to the unit that is actually rounded
A hypothetical service can charge each allocation with a minimum duration and a subsequent billing quantum. Apply that rule to each eligible lifecycle before aggregation. Rounding total fleet time can understate a bill when many short allocations each incur a minimum. Conversely, rounding every task independently would overstate it if tasks legally share one continuing billed allocation. Cancellation, suspension, and restart may define new lifecycles under a real contract. Read those rules rather than infer them from a smooth utilization graph or a convenient arithmetic simplification.
The formula here is one deliberately specified policy: a positive quantum, a minimum duration, and upward rounding of the larger duration for each allocation. It is not a universal cloud-billing equation. Convert seconds to hours only after using consistent units inside the rounding operation. Different resource classes can have different units and policies, so aggregate their computed costs rather than their raw quantities. A smaller number of requests does not establish a smaller bill unless it changes a quantity or rule that actually carries a charge.
Keep the accounting evidence attached to the quantity
A billing export can distinguish raw usage amount from amount in pricing units, a usage interval from an invoice period, and a resource identifier from an optional or missing field. Fee, usage, credit, refund, and adjustment records may follow different semantics. Multiplying every row by an apparent rate can duplicate an already calculated cost or mishandle a fee with no usage quantity. Preserve charge type, rate version, currency or accounting unit, and record identity; reconcile one documented basis instead of making every column look interchangeable.
The function lab provides a continuous resource-count analogy. Reset, explicitly set a=0.75 and x=2, predict the integral, then Play or Step. Repeat from a fresh Reset with a=1.5 and x=2 explicitly set. For the normalized curve n(t)=a t² from zero to x, displayed areas are two and four. They are normalized count-time units, not device-hours inferred from a real cluster. The instrument has no allocations, billing minima, invoice records, or rounding. Its useful lesson is why an area and an endpoint count are different quantities.
Work it through
Two short allocations carry three billable minutes
Use two separate single-device allocations lasting fifty and seventy seconds. The fictional policy has a sixty-second minimum and sixty-second quantum, with a fictional rate of twelve FC per device-hour.
Apply the policy separately: fifty seconds becomes sixty, and seventy becomes 120. The total is 180 device-seconds. Rounding their combined 120 seconds instead would silently remove one allocation minimum.
Convert 180/3600=0.05 device-hours, then multiply by twelve FC/device-hour to obtain 0.6 FC. The conversion preserves dimensions and applies the rate only once.
Actual allocated time was 120 seconds, or one thirtieth of a device-hour. An unrounded hypothetical charge would be 0.4 FC, but that is not the charge under the policy we specified. Neither quantity measures useful kernel work.
The fictional bill is 0.6 FC; actual allocation time and rounded billable time remain separately auditable.
The living notebook
Explore the model
Interactive lab · function
Area is different from an allocation endpoint
Use independent Reset → explicitly set BOTH a and x → predict → Play/Step runs for (0.75,2) and (1.5,2). Areas are two and four under y=ax². The instrument models neither billing rounds nor allocation events.
- y at chosen x
- 0.608
- Tangent slope · 2ax
- 1.35
- Signed area · ax³/3
- 0.182
This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forAttach dimensions and a lifecycle boundary before treating an area as a priced quantity.
Pause & reason
Check your understanding
Your turn
Try it yourself
Three separate ten-second allocations have a fictional sixty-second minimum, one-second quantum, and rate six FC/device-hour. Calculate their charge. What would one genuinely continuing thirty-second allocation cost under the same policy?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Apply the minimum separately to the actual lifecycles, then convert their total seconds to hours.
Compare with the solution
Three allocations contribute 3×60=180 billable device-seconds, or 0.05 device-hours, costing 0.3 FC. A single continuing thirty-second allocation would contribute sixty seconds and cost 0.1 FC. That second arithmetic case requires a genuinely shared legal billing lifecycle and compatible work requirements; placing three tasks in one report does not create it. Keep execution performance, isolation, and failure behavior in the comparison as well as the fictional minimum.
Keep the idea
Take it with you
- Preserve resource identity, lifetime, and dimensional units.
- Apply minimums and rounding at the specified lifecycle boundary.
- Reconcile charge types and pricing units before aggregating cost.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.