Dashing widget to display Sonar metrics, connecting to either a secured or unsecured Sonar repository.
I created this widget after originally attempting to use EHadoux's simple Sonar widget, which did not allow access to my company's secured Sonar instance. Additionally, I implemented the ability to set up the widget using an external configuration file.
Please note that this is technically a job versus a widget, in that it periodically requests data from Sonar and pushes that to the list widget as the view.
The list widget packaged with the Dashing framework.
##Usage
Copy sonar.rb
and sonar.cfg
into the jobs
directory.
Add the following snippet to the dashboard layout file:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="sonar" data-view="List" data-title="sonar stats" data-unordered="true" data-moreinfo="values as %">
</div>
</li>
To display more metrics, increase the data-sizey attribute.
Change the values for the configuration in sonar.cfg
. All values are required except for username
and password
. If no username is provided, it is assumed the Sonar instance is unsecured. Order of display in the widget is dictated by the order of configured metrics.
If sonar.cfg
is not found, the dashboard will fail to start with a "file not found" message.
Job implementation requires restarting Dashing if you change the configuration file.
@centic9, started working on sonar integration today and I made a small function to get a value in a slightly better way.
Which you can call using
This helps not to rely on an index in the resulting array. And makes it easier using other metrics.