How to add data-view and how to generate a report?

Asked by Prince Mathew

I want to use the dashboard to archive some data. I was able to use the cl to upload bundles.
But I am not able to figure out
1) How to add a data-view?
2) How to generate a report in launch-pad?

Question information

Language:
English Edit question
Status:
Answered
For:
LAVA Dashboard (deprecated) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Zygmunt Krynicki (zyga) said :
#1

Hi.

1) How to add a data-view?

Both data views and reports are based on plain text files you outgh to put somewhere in the filesystem. If you look at the layout of http://bazaar.launchpad.net/~linaro-validation/lava-dashboard/data-views-and-reports/files you can see how we structured data views and reports to go into their own directories. The way to make lava dashboard aware of your files is to edit /etc/lava-server/settings.conf and put the following snippet of JSON inside:

{
  "DATAVIEW_DIRS": ["/path/to/dataview/directory"],
  "DATAREPORT_DIRS": ["/path/to/datareport/directory"]
}

Since typically this file does not exist it should be fine if you just put this snippet in. Make sure to make it correct JSON (no trailing commas, etc) and make sure the paths point to the directory with your files. As you start up lava-server (or restart it) it will log any errors (including syntax errors in actual files) to apache error log file.

2) How to generate a report in launch-pad.

Unless you meant dashboard, not lanchpad I cannot help you as we don't support any interaction with launchpad at this time. To generate reports you need to write snippets of javascript code and place them in .html file that gets read by the dashboard. You should look at existing reports in the bzr branch I linked to above. In general the procedure looks like this:

* Determine what you wish to display
* Map that onto data you stored into the dashboard
* Figure out which data views you will need for this report, either write or reuse existing data views
* Write a piece of javascript that queries all the data views you want (using our javascript support library)
* Compose the final HTML from the data (you can use the two shortcuts we provide: data as table and data-as-chart).

Can you help with this problem?

Provide an answer of your own, or ask Prince Mathew for more information if necessary.

To post a message you must log in.