dashML is built with RXQ and included in that repo as an example of building RESTful apps with MarkLogic.
I thought it would be fun to cook up a little bauble that leverages new features found in MarkLogic 7.
MarkLogic 7.0 introduces more tools for monitoring the performance of your MarkLogic server. dashML leverages these tools to make it easy to create lightweight, dashboards giving you up-to-date information on the health and performance of your applications.
dashML provides a tabbed interface of MarkLogic server history monitoring metrics.
This provides a snapshot of the health of your server which you can view on your smart phone, tablet or any browser that supports responsive templates.
MarkLogic 7.0 (latest version)
First, you need to download and install MarkLogic 7.
Second, create an appserver, providing the following details;
- root: provide directory where dashml/src/xquery was copied to your filesystem (ex. /opt/dashml/src/xquery)
- port: choose a port ####
- set database: set to Meters database
- set error handler: /rxq-rewriter.xqy?mode=error
- set rewrite handler: /rxq-rewriter.xqy?mode=rewrite
If you are installing on a brand new ML7 instance, you may have to wait a little while to give a chance for some metrics to be collected before building (and viewing) dashboards.
With everything setup, you can now point your web browser to http://localhost:#### (where ### is the port number you choose when setting up appserver) and you should see dashML homepage.
Click onto instructions tab or go direct to building dashboards.
Just goto http://localhost:####/instructions
then start building simple dashboards.
create an appserver, providing the following details;
- root: provide directory where dashml/src ison your filesystem
- port: choose a port ####
- set database: set to Meters database
- amend src/test/dash-model line 59 to point to full path where etc/dash.xsd is
Now point your web browser to http://localhost:####/xray which will run all tests.
- 'X is not working' - make sure you have run long enough for meters to be generated (or switch to last 60 minutes)
- submit an issue
some thoughts on future features
- make widgets and dash standalone (consume json endpoints)
- add resource selection
- different widget types
- add replica to database
- customise everything (colors, etc)
- reordering
- add thresholds for alerting
- add start & end selection
- time constraints = quick code generate ('though there are some xray unit tests' he says in a hopeful tone ...)
- I made GET do bad things (as in not idempotent)
- no error checking (other then schema validation)
- probably a long list of other things done poorly ...
dashML is released under Apache License, Version 2.0
The following are links on the other technologies used in this application.
- RXQ github repository.
- purecss - css templates
- EXQuery RESTXQ Draft Specification.
- Adam Retter's RESTXQ.
- JSR-311.
The usage of RESTXQ annotations turns out to be a very concise way of building up flexible RESTFul interfaces, as well as providing the basis from which to create MVC architectures for our XQuery web applications.