Skip to content

Commit

Permalink
add docs for verbose timing option
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsmyth committed May 13, 2024
1 parent e91f982 commit 2ddef3a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/reference/cli/check.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ steampipe check list
</tr>

<tr>
<td nowrap="true"> <inlineCode>--timing </inlineCode> </td>
<td>Turn on the query timer. </td>
<td nowrap="true"> <inlineCode>--timing=string </inlineCode> </td>
<td>Enable or disable query execution timing: <inlineCode>off</inlineCode> (default), <inlineCode>on</inlineCode>, or <inlineCode>verbose</inlineCode> </td>
</tr>

<tr>
Expand Down
14 changes: 10 additions & 4 deletions docs/reference/cli/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Execute SQL queries interactively, or by a query argument.

To open the interactive query shell, run `steampipe query` with no arguments. The query shell provides a way to explore your data and run multiple queries.

If a query string is passed on the command line then it will be run immediately and the command will exit. Alternatively, you may specify one or more files containing SQL statements. You can run multiple SQL files by passing a glob or a space separated list of file names.
If a query string is passed on the command line then it will be run immediately and the command will exit. Alternatively, you may specify one or more files containing SQL statements. You can run multiple SQL files by passing a glob or a space-separated list of file names.

If the Steampipe service was previously started by `steampipe service start`, steampipe will connect to the service instance - otherwise, the query command will start the `service`. At the end of the query command or session, if other sessions have not connected to the `service` already, the `service` will be shutdown. If other session have already connected to the `service`, then the last session to exit will shutdown the `service`.
If the Steampipe service was previously started by `steampipe service start`, steampipe will connect to the service instance - otherwise, the query command will start the `service`. At the end of the query command or session, if other sessions have not connected to the `service` already, the `service` will be shutdown. If other sessions have already connected to the `service`, then the last session to exit will shutdown the `service`.

## Usage
Run Steampipe [interactive query shell](/docs/query/query-shell):
Expand Down Expand Up @@ -148,8 +148,8 @@ steampipe query list


<tr>
<td nowrap="true"> <inlineCode>--timing </inlineCode> </td>
<td>Turn on the query timer. </td>
<td nowrap="true"> <inlineCode>--timing=string </inlineCode> </td>
<td>Enable or disable query execution timing: <inlineCode>off</inlineCode> (default), <inlineCode>on</inlineCode>, or <inlineCode>verbose</inlineCode> </td>
</tr>


Expand Down Expand Up @@ -229,6 +229,12 @@ Run a specific query directly and report the query execution time:
steampipe query "select * from aws_s3_bucket" --timing
```

Run a specific query directly and report the query execution time and details for each scan:
```bash
steampipe query "select * from aws_s3_bucket" --timing=verbose
```


Run a specific query directly and return output in json format:
```bash
steampipe query "select * from aws_s3_bucket" --output json
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/config-files/workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ These options often correspond to CLI flags.
<tr>
<td><inlineCode>timing</inlineCode></td>
<td><inlineCode>false</inlineCode></td>
<td>Enable or disable query execution timing. <br /> <br /> CLI: <inlineCode>--timing</inlineCode></td>
<td>Enable or disable query execution timing: <inlineCode>off</inlineCode>/<inlineCode>false</inlineCode>, <inlineCode>on</inlineCode>/<inlineCode>true</inlineCode>, or <inlineCode>verbose</inlineCode> <br /> <br /> CLI: <inlineCode>--timing</inlineCode></td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -157,7 +157,7 @@ These option often correspond to CLI flags.
<tr>
<td><inlineCode>timing</inlineCode></td>
<td><inlineCode>false</inlineCode></td>
<td>Enable or disable query execution timing. <br /> <br /> CLI: <inlineCode>--timing</inlineCode></td>
<td>Enable or disable query execution timing: <inlineCode>off</inlineCode>/<inlineCode>false</inlineCode>, <inlineCode>on</inlineCode>/<inlineCode>true</inlineCode>, or <inlineCode>verbose</inlineCode> <br /> <br /> CLI: <inlineCode>--timing</inlineCode></td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -227,14 +227,14 @@ workspace "all_options" {
multi = false # true, false
output = "table" # json, csv, table, line
separator = "," # any single char
timing = true # true, false
timing = true # true, false, verbose
}
options "check" {
header = true # true, false
output = "text" # brief, csv, html, json, md, text, snapshot or none (default "text")
separator = "," # any single char
timing = true # true, false
timing = true # true, false, verbose
}
options "dashboard" {
Expand Down
19 changes: 16 additions & 3 deletions docs/reference/dot-commands/timing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ title: .timing
sidebar_label: .timing
---


# .timing
Turn query execution timing on or off.

Enable or disable query execution timing:


| Level | Description
|-----------|-------------------------
| `off` | Turn off query timer (default)
| `on` | Display time elapsed after every query
| `verbose` | Display time elapsed and details of each scan


## Usage
```
.timing [on | off]
.timing [on | off | verbose]
```

## Examples
Expand All @@ -22,4 +30,9 @@ Turn off query timing:
Turn on query timing:
```
.timing on
```

Turn on verbose query timing:
```
.timing verbose
```

0 comments on commit 2ddef3a

Please sign in to comment.