Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for --profile flag. #6773

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 53 additions & 34 deletions docs/pages/repo/docs/reference/command-line-reference/run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ turbo run dev --parallel --no-cache
Generates a trace of the run in Chrome Tracing format that you can use to analyze performance.
The profile can be viewed in [Perfetto](https://ui.perfetto.dev/).

You must provide a verbosity flag (`-v`, `-vv`, or `-vvv`) with the `--profile` to produce a trace.

```sh
turbo run build --profile=profile.json
```
Expand Down Expand Up @@ -406,35 +408,32 @@ turbo run build --preflight

The same behavior can also be set via the `TURBO_PREFLIGHT=true` environment variable.

### `--trace`

`type: string`
### `--verbosity`

To view CPU trace, outputs the trace to the given file, use `go tool trace [file]`.
To specify log level, use `--verbosity=<num>` or `-v, -vv, -vvv`.

<Callout>
**Important**: The trace viewer doesn't work under Windows Subsystem for
Linux.
</Callout>
- `Info `: `--verbosity=1`, or `-v`
- `Debug`: `--verbosity=2`, or `-vv`
- `Trace`: `--verbosity=3`, or `-vvv`

```sh
turbo run build --trace="<trace-file-name>"
turbo run build -v
turbo run build --verbosity=2
turbo run build -vvv
```

### `--heap`

`type: string`

To view heap trace, outputs the trace to the given file, use `go tool pprof [file]` and type `top`. You can also drop it into [speedscope](https://www.speedscope.app/) and use the `left heavy` or `sandwich` view modes.

```sh
turbo run build --heap="<heap-file-name>"
```
## Deprecated Options

### `--cpuprofile`

`type: string`

<Callout type="error">
`--cpuprofile` is deprecated in `1.11.x`. Please use
[`--profile`](#--profile)
instead.
</Callout>

To view CPU profile, outputs the profile to the given file, drop the file into [speedscope](https://www.speedscope.app/).

<Callout>
Expand All @@ -447,22 +446,6 @@ To view CPU profile, outputs the profile to the given file, drop the file into [
turbo run build --cpuprofile="<cpu-profile-file-name>"
```

### `--verbosity`

To specify log level, use `--verbosity=<num>` or `-v, -vv, -vvv`.

- `Info `: `--verbosity=1`, or `-v`
- `Debug`: `--verbosity=2`, or `-vv`
- `Trace`: `--verbosity=3`, or `-vvv`

```sh
turbo run build -v
turbo run build --verbosity=2
turbo run build -vvv
```

## Deprecated Options

### `--include-dependencies`

<Callout type="error">
Expand Down Expand Up @@ -502,6 +485,21 @@ cached. Then, you change a line of code in B. With the `--deps` flag on, running
because they are not impacted by the change. If you were to run
`turbo run build --no-deps` instead, turbo will only run `build` in B.

### `--heap`

<Callout type="error">
`--heap` is deprecated in `1.2.x`. Please use
[`--profile`](#--profile) instead.
</Callout>

`type: string`

To view heap trace, outputs the trace to the given file, use `go tool pprof [file]` and type `top`. You can also drop it into [speedscope](https://www.speedscope.app/) and use the `left heavy` or `sandwich` view modes.

```sh
turbo run build --heap="<heap-file-name>"
```

### `--scope`

<Callout type="error">
Expand Down Expand Up @@ -539,6 +537,27 @@ turbo run build --since=origin/main
input files for a workspace exist inside their respective workspace folders.
</Callout>

### `--trace`

<Callout type="error">
`--trace` is deprecated in `1.11.x`, use
[`--profile`](#--profile)
instead.
</Callout>

`type: string`

To view CPU trace, outputs the trace to the given file, use `go tool trace [file]`.

<Callout>
**Important**: The trace viewer doesn't work under Windows Subsystem for
Linux.
</Callout>

```sh
turbo run build --trace="<trace-file-name>"
```

[1]: /repo/docs/reference/configuration#passThroughEnv
[2]: /repo/docs/reference/configuration#globalPassThroughEnv
[3]: /repo/docs/core-concepts/monorepos/filtering
3 changes: 3 additions & 0 deletions profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[

]
anthonyshew marked this conversation as resolved.
Show resolved Hide resolved