https://github.com/mitchellh/lifeguard-random
Data source plugin for Lifeguard that generates random numbers.
https://github.com/mitchellh/lifeguard-random
Last synced: about 2 months ago
JSON representation
Data source plugin for Lifeguard that generates random numbers.
- Host: GitHub
- URL: https://github.com/mitchellh/lifeguard-random
- Owner: mitchellh
- Created: 2012-06-07T00:17:58.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2012-06-07T22:52:16.000Z (about 13 years ago)
- Last Synced: 2025-04-26T03:34:36.315Z (2 months ago)
- Language: Shell
- Size: 227 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lifeguard Random Data Source
This is an example of a plugin for Lifeguard that implements a data source.
The data source in this example simply generates random numbers.## Installation
To install the plugin, compile it and generate the release folder:
$ make deps
$ make relThere will now be a folder `rel/lifeguard_random`. Copy this folder
into your Lifeguard plugin directory and add `lifeguard_random` to the
list of enabled plugins for Lifeguard. That's it!## Usage
Once the plugin is installed, you can use the random data source with your
watches. To do this, enable the plugin and add a new data source to your
`sys.config` file. Example:```erlang
{data_sources, [
{"random", lifeguard_ds_random, []}
]},
{plugins, [lifeguard_random]}
```Then, you can query it like this from a watch:
```javascript
// Get one random number (in an array)
var data = Lifeguard.get("random");// Get 10 random numbers
var data = Lifeguard.get("random", 10);
```