浏览代码

Expose sample_index argument through web ui (#412)

The option is exposed in the web ui's query string under a
new `?si=<sample_index>` parameter. This is particularly
useful for heap profiles, where switching between the four
indices (alloc_objects, alloc_space, inuse_objects, and inuse_space)
is a common task.

We could add a menu to the UI to make discovery of these
options easier, but for now this seems sufficient.
Nathan VanBenschoten 6 年前
父节点
当前提交
e98137b3ea
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2
    0
      internal/driver/webui.go

+ 2
- 0
internal/driver/webui.go 查看文件

201
 		{"s", "show"},
201
 		{"s", "show"},
202
 		{"i", "ignore"},
202
 		{"i", "ignore"},
203
 		{"h", "hide"},
203
 		{"h", "hide"},
204
+		{"si", "sample_index"},
204
 	} {
205
 	} {
205
 		if v := pprofVariables[p.key].value; v != "" {
206
 		if v := pprofVariables[p.key].value; v != "" {
206
 			q.Set(p.param, v)
207
 			q.Set(p.param, v)
232
 	vars["show"].value = u.Query().Get("s")
233
 	vars["show"].value = u.Query().Get("s")
233
 	vars["ignore"].value = u.Query().Get("i")
234
 	vars["ignore"].value = u.Query().Get("i")
234
 	vars["hide"].value = u.Query().Get("h")
235
 	vars["hide"].value = u.Query().Get("h")
236
+	vars["sample_index"].value = u.Query().Get("si")
235
 	return vars
237
 	return vars
236
 }
238
 }
237
 
239