Automating bugzilla metrics query

旧时模样 提交于 2019-12-25 16:41:37

问题


I have been using bugzillametrics to generate metrics from Bugzilla. I really love the product. One of the things that I am trying to do is to automate the query process, meaning, instead of opening up a browser and running the query link everyday, i want to run it using a cronjob. In talking with the developer of bugzillametrics, looks like there is a client side javascript that runs to generate the snapshot from the query. To automate the process, I am using phantomjs. However, with my phantomjs script, the client side javascript does not run and I dont get any graph. here is what i am trying to do

var webPage = require('webpage');
var page = webPage.create();
var postBody1 = '';

page.open('http://1.1.1.1:8080/BugzillaMetrics1_3/#calculate_query,6.0.5a/',function(status) {
console.log('Status: ' + status);
var content = page.content;
console.log('Content: ' + content);
});

When I run it using the command line "./phantomjs post.js", I get the o/p

Status: success
Content: <!DOCTYPE html><html class=" ext-strict"><head>
<It also downloads the html source and displays it here".

However, the query does not run because I dont see any snapshot being created in the database of bugzillametrics.

If I go to the query using the browser, I see the following in the access_log

1.1.1.1 - - [02/Sep/2014:14:47:29 -0700] "POST /BugzillaMetrics1_3/MetricsUI/MetricResultService HTTP/1.1" 200 165
1.1.1.1 - - [02/Sep/2014:14:47:30 -0700] "POST /BugzillaMetrics1_3/MetricsUI/MetricResultService HTTP/1.1" 200 147
1.1.1.1 - - [02/Sep/2014:14:47:30 -0700] "GET /BugzillaMetrics1_3/ajax-loader.gif HTTP/1.1" 200 6494
1.1.1.1 - - [02/Sep/2014:14:47:30 -0700] "GET /BugzillaMetrics1_3/MetricsUI/displayResult?filename=Total_Bugs_in_this_release_02-09-2014_14-47-29_909.jpg HTTP/1.1" 200 158214

Looks like my phantomjs script is not correct ? What can I do to fix this ?

Thanks, Sunray

来源:https://stackoverflow.com/questions/26067919/automating-bugzilla-metrics-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!