Graphs using http_proxy

68 views
Skip to first unread message

Tom Brandish

unread,
Apr 10, 2014, 12:31:24 PM4/10/14
to team_da...@googlegroups.com
Hello,

I'm trying to setup a simple line graph using a JSON from my jenkins server as the source of data.  I have created a Graph widget on my dashboard and set the source to http_proxy.  I set my Proxy URL to a JSON coming from my jenkins server:


My JSON contains the following data:

{"builds":[{"duration":0,"number":69},{"duration":5966858,"number":68},{"duration":10799446,"number":67},{"duration":6329780,"number":65},{"duration":8475224,"number":64},{"duration":9114256,"number":63},{"duration":13621139,"number":62},{"duration":10305931,"number":61},{"duration":10657575,"number":60},{"duration":11343232,"number":59},{"duration":9571664,"number":58},{"duration":7361343,"number":57},{"duration":6283976,"number":56},{"duration":11084789,"number":55},{"duration":10629001,"number":54},{"duration":11262444,"number":51},{"duration":4697608,"number":48},{"duration":10973732,"number":46},{"duration":5579112,"number":45},{"duration":11145336,"number":44},{"duration":5315106,"number":42},{"duration":6336381,"number":41},{"duration":6211830,"number":40},{"duration":5817633,"number":35},{"duration":8636956,"number":34},{"duration":5317603,"number":32},{"duration":11551784,"number":31},{"duration":5678030,"number":30},{"duration":11772446,"number":29},{"duration":6460126,"number":28},{"duration":11667357,"number":27},{"duration":10704444,"number":25},{"duration":6331461,"number":23}]}

My Targets to builds.number;builds.duration.  I would like to see a graph with the x-axis being the build number and the y-axis being duration (in milliseconds...).

However, I am seeing an empty graph and no response data in the log:

Started GET "/api/data_sources/datapoints?from=1394686800&source=http_proxy&to=1397192399&widget_id=21" for 134.64.81.222 at 2014-04-10 11:29:40 -0500
Processing by Api::DataSourcesController#index as JSON
  Parameters: {"from"=>"1394686800", "source"=>"http_proxy", "to"=>"1397192399", "widget_id"=>"21", "kind"=>"datapoints"}
  Widget Load (0.3ms)  SELECT `widgets`.* FROM `widgets` WHERE `widgets`.`id` = 21 LIMIT 1
  CACHE (0.0ms)  SELECT `widgets`.* FROM `widgets` WHERE `widgets`.`id` = 21 LIMIT 1  [["id", "21"]]
I, [2014-04-10T11:29:40.910778 #8437]  INFO -- : get http://jenkins:8080/job/Iris-Integration/api/json?tree=builds%5Bnumber%2Cduration%5D&from=1394686800&to=1397192399&targets%5B%5D=builds.duration&targets%5B%5D=builds.number
D, [2014-04-10T11:29:40.910837 #8437] DEBUG -- request: User-Agent: "Faraday v0.8.8"
I, [2014-04-10T11:29:40.919587 #8437]  INFO -- Status: 200
D, [2014-04-10T11:29:40.919663 #8437] DEBUG -- response: date: "Thu, 10 Apr 2014 16:29:40 GMT"
server: "Jetty(8.y.z-SNAPSHOT)"
x-jenkins: "1.555"
x-jenkins-session: "a29d4a3d"
content-type: "application/json;charset=UTF-8"
content-length: "313"
connection: "close"
Completed 200 OK in 16ms (Views: 0.1ms | ActiveRecord: 0.3ms)

Any help would be appreciated.


Frederik Dietz

unread,
Apr 15, 2014, 2:28:15 PM4/15/14
to team_da...@googlegroups.com
Hi Tom,

the JSON format returned by Jenkins is not in the format expected by the graph widget. 

Have a look at the docs with an example for the Graph widget using the http proxy:

Cheers,
Frederik


--
You received this message because you are subscribed to the Google Groups "Team Dashboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to team_dashboar...@googlegroups.com.
To post to this group, send email to team_da...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/team_dashboard/30ec3cf1-80a4-4568-9bf4-e08d2a043318%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Brandish

unread,
Apr 22, 2014, 4:13:21 PM4/22/14
to team_da...@googlegroups.com
Thanks, I've been learning alot about graphs the past few days.  I am liking your dashboard framework.  

I also created a new widget to display jenkins build times in minutes instead of the default milliseconds  :-)

Frederik Dietz

unread,
Apr 25, 2014, 7:51:23 AM4/25/14
to team_da...@googlegroups.com
Great that you got it working!


Reply all
Reply to author
Forward
0 new messages