https://github.com/firstandthird/hapi-dashboard
Hapi plugin for displaying metrics on a dashboard
https://github.com/firstandthird/hapi-dashboard
hapi-plugin
Last synced: 10 months ago
JSON representation
Hapi plugin for displaying metrics on a dashboard
- Host: GitHub
- URL: https://github.com/firstandthird/hapi-dashboard
- Owner: firstandthird
- Created: 2014-10-02T22:11:18.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-05-17T06:09:57.000Z (over 8 years ago)
- Last Synced: 2025-04-11T01:12:08.753Z (10 months ago)
- Topics: hapi-plugin
- Language: JavaScript
- Size: 71.3 KB
- Stars: 2
- Watchers: 5
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
hapi-dashboard
==============
Hapi plugin for displaying metrics on a dashboard
## Installation
`npm install --save hapi-dashboard`
## Usage
```js
server.pack.register([
{ plugin: require('hapi-dashboard'), options: {
//defaults shown below
endpoint: '/dashboard'
dashboards: {},
ttl: 60*1000, //time to cache responses. 60 seconds
concurrent: 20, //max metrics to process at once
password: 'something', //password used to access dashboards
favicon: 'favicon.png' // Also used as home screen icon for ios
}}
], function(err) {
});
```
## Dashboards Object
Dashboards object should look something like this:
```js
{
'dashboard-1': {
name: 'Dashboard 1',
metrics: {
loggedIn: {
value: function(server, done) {
//perform some async call
server.plugins.db.metrics.loggedInCount(function(err, result) {
done(null, {
name: 'Number of times a user logged in',
value: result.total
});
}
},
ttl: 60
}
}
}
}
```