perf101 / rage

Results And Graphing Engine
Other
8 stars 8 forks source link

HTTP handler to return graph as image #36

Open jjd27 opened 12 years ago

jjd27 commented 12 years ago

Can we have an HTTP handler that returns a PNG, please?

e.g. I'd like to go to http://perf/graph?width=640&height=480&som=41&xaxis=build_number&x_as_seq=on&legend_position=se&v_product=XenServer&f_branch=1&v_build_tag=&v_dom0_memory_static_max=752&v_machine_type=Dell+PowerEdge+2950&v_memsize=256&v_vmtype=dom0 and get just the graph as a PNG.

chengsun commented 12 years ago

This could be achieved with something like PhantomJS. We'd have to do the rendering server-side.

On Aug 8, 2012 5:24 PM, "Jonathan Davies" notifications@github.com wrote:

Can we have an HTTP handler that returns a PNG, please?

e.g. I'd like to go to http://perf/graph?som=41&xaxis=build_number&x_as_seq=on&legend_position=se&v_product=XenServer&f_branch=1&v_build_tag=&v_dom0_memory_static_max=752&v_machine_type=Dell+PowerEdge+2950&v_memsize=256&v_vmtype=dom0and get just the graph as a PNG.

— Reply to this email directly or view it on GitHub.

rokstrnisa commented 12 years ago

This could be achieved by drawing the graph normally, and then automatically pressing the Get Image button. However, the file returned has a weird extension, and needs to be saved as a PNG.

chengsun commented 12 years ago

I thought that Jonathan meant an URL which can be embedded in another page, i.e. <img src="http://perf/graph?...">.

jjd27 commented 12 years ago

Yes, that's what I mean. So the http handler for "graph" would actually return the PNG in the http response.

rokstrnisa commented 12 years ago

Ah, then Cheng's suggestion is probably best.