MCPcopy Create free account
hub / github.com/google/pprof / makeReport

Method makeReport

internal/driver/webui.go:261–282  ·  view source on GitHub ↗

makeReport generates a report for the specified command. If configEditor is not null, it is used to edit the config used for the report.

(w http.ResponseWriter, req *http.Request,
	cmd []string, configEditor func(*config))

Source from the content-addressed store, hash-verified

259// makeReport generates a report for the specified command.
260// If configEditor is not null, it is used to edit the config used for the report.
261func (ui *webInterface) makeReport(w http.ResponseWriter, req *http.Request,
262 cmd []string, configEditor func(*config)) (*report.Report, []string) {
263 cfg := currentConfig()
264 if err := cfg.applyURL(req.URL.Query()); err != nil {
265 http.Error(w, err.Error(), http.StatusBadRequest)
266 ui.options.UI.PrintErr(err)
267 return nil, nil
268 }
269 if configEditor != nil {
270 configEditor(&cfg)
271 }
272 catcher := &errorCatcher{UI: ui.options.UI}
273 options := *ui.options
274 options.UI = catcher
275 _, rpt, err := generateRawReport(ui.copier.newCopy(), cmd, cfg, &options)
276 if err != nil {
277 http.Error(w, err.Error(), http.StatusBadRequest)
278 ui.options.UI.PrintErr(err)
279 return nil, nil
280 }
281 return rpt, catcher.errors
282}
283
284// renderHTML generates html using the named template based on the contents of data.
285func renderHTML(dst io.Writer, tmpl string, rpt *report.Report, errList, legend []string, data webArgs) error {

Callers 6

dotMethod · 0.95
topMethod · 0.95
disasmMethod · 0.95
sourceMethod · 0.95
peekMethod · 0.95
stackViewMethod · 0.95

Calls 5

currentConfigFunction · 0.85
generateRawReportFunction · 0.85
applyURLMethod · 0.80
newCopyMethod · 0.80
PrintErrMethod · 0.65

Tested by

no test coverage detected