Skip to content

Commit 410f7a6

Browse files
committed
docs: add missing usage import to run-usage code examples
Add the missing import statements for the usage object from @trigger.dev/sdk/v3 to the code examples in the run-usage docs.
1 parent edf5b14 commit 410f7a6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/run-usage.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ description: "Get compute duration and cost from inside a run, or for a specific
88
You can get the cost and duration of the current including retries of the same run.
99

1010
```ts
11+
import { task, usage, wait } from "@trigger.dev/sdk/v3";
12+
1113
export const heavyTask = task({
1214
id: "heavy-task",
1315
machine: {
@@ -87,6 +89,8 @@ console.log("Total cost", totalCost);
8789
You can also wrap code with `usage.measure` to get the cost and duration of that block of code:
8890

8991
```ts
92+
import { usage, logger } from "@trigger.dev/sdk/v3";
93+
9094
// Inside a task run function, or inside a function that's called from there.
9195
const { result, compute } = await usage.measure(async () => {
9296
//...Do something for 1 second

0 commit comments

Comments
 (0)