You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-1Lines changed: 45 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ The core goal is to ensure compatibility with .http files from IntelliJ or VSCod
17
17
-[Commands](#commands)
18
18
-[Keybindings](#keybindings)
19
19
-[Response handler](#response-handler)
20
+
-[Request Profiling](#request-profiling)
20
21
-[Telescope Integration](#telescope-integration)
21
22
-[Documentation](#documentation)
22
23
-[Examples](#examples)
@@ -40,6 +41,7 @@ The core goal is to ensure compatibility with .http files from IntelliJ or VSCod
40
41
- Syntax highlighting for .http files and response buffers
41
42
- Verbose mode for debugging
42
43
- Dry run capability for request inspection
44
+
- Request profiling with detailed timing metrics
43
45
- Telescope integration for environment selection
44
46
- Compatible with [JetBrains HTTP Client](https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html) and [VSCode Restclient](https://github.com/Huachao/vscode-restclient)
45
47
@@ -76,13 +78,19 @@ local http_client = require("http_client")
76
78
localconfig= {
77
79
default_env_file='.env.json',
78
80
request_timeout=30000, -- 30 seconds
81
+
profiling= {
82
+
enabled=true,
83
+
show_in_response=true,
84
+
detailed_metrics=true,
85
+
},
79
86
keybindings= {
80
87
select_env_file="<leader>hf",
81
88
set_env="<leader>he",
82
89
run_request="<leader>hr",
83
90
stop_request="<leader>hs",
84
91
dry_run="<leader>hd",
85
-
toggle_verbose="<leader>hv"
92
+
toggle_verbose="<leader>hv",
93
+
toggle_profiling="<leader>hp"
86
94
},
87
95
}
88
96
@@ -115,6 +123,7 @@ You can adjust these settings to your preferences.
115
123
-`:HttpRunAll`: Run all HTTP requests in the current file.
116
124
-`:HttpStop`: Stop the currently running HTTP request.
117
125
-`:HttpVerbose`: Toggle verbose mode for debugging.
126
+
-`:HttpProfiling`: Toggle request profiling.
118
127
-`:HttpDryRun`: Perform a dry run of the request under the cursor.
119
128
-`:HttpCopyCurl`: Copy the curl command for the HTTP request under the cursor.
120
129
@@ -136,6 +145,7 @@ The plugin comes with the following default keybindings:
136
145
-`<leader>hr`: Run HTTP request under cursor
137
146
-`<leader>hx`: Stop running HTTP request
138
147
-`<leader>hv`: Toggle verbose mode
148
+
-`<leader>hp`: Toggle request profiling
139
149
-`<leader>hd`: Perform dry run
140
150
-`<leader>hc`: Copy curl command for HTTP request under cursor
141
151
@@ -156,6 +166,7 @@ To customize these keybindings, you can add the following to your Neovim configu
@@ -164,6 +175,7 @@ To customize these keybindings, you can add the following to your Neovim configu
164
175
"HttpRun",
165
176
"HttpStop",
166
177
"HttpVerbose",
178
+
"HttpProfiling",
167
179
"HttpDryRun"
168
180
},
169
181
}
@@ -191,6 +203,38 @@ GET {{base_url}}/protected
191
203
Authorization: Bearer {{auth_token}}
192
204
```
193
205
206
+
### Request Profiling
207
+
208
+
The plugin includes request profiling capabilities that show you detailed timing metrics for your HTTP requests.
209
+
210
+
#### Configuration
211
+
212
+
You can configure profiling in your setup:
213
+
214
+
```lua
215
+
profiling= {
216
+
enabled=true, -- Enable or disable profiling
217
+
show_in_response=true, -- Show timing metrics in response output
218
+
detailed_metrics=true, -- Show detailed breakdown of timings
219
+
},
220
+
```
221
+
222
+
#### Viewing Timing Metrics
223
+
224
+
When profiling is enabled, the response window will include a "Timing" section that shows:
225
+
226
+
- Total request time
227
+
- DNS resolution time
228
+
- TCP connection time
229
+
- TLS handshake time (for HTTPS requests)
230
+
- Request sending time
231
+
- Content transfer time
232
+
233
+
#### Commands and Keybindings
234
+
235
+
-`:HttpProfiling` - Toggle profiling on/off
236
+
-`<leader>hp` - Default keybinding to toggle profiling
237
+
194
238
### Running Without Environment
195
239
You can now run requests without selecting an environment file. If environment variables are needed but not set, the plugin will display a message suggesting to select an environment file or set properties via a response handler.
0 commit comments