Skip to content

Commit 7781e2a

Browse files
authored
docs: usage function examples were missing the imports (#2830)
Closes #2828
1 parent 8e00344 commit 7781e2a

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";
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";
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)