dashboarder 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +16 -4
- data/lib/dashboarder/instrument.rb +13 -6
- data/lib/dashboarder/version.rb +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -4,14 +4,22 @@ An experimental library to help in the construction of Librato Metrics dashboard
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'dashboarder'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install dashboarder
|
8
18
|
|
9
19
|
## Usage
|
10
20
|
|
11
21
|
```bash
|
12
|
-
$
|
13
|
-
$ export LIBRATO_KEY=123456
|
14
|
-
$ bundle exec irb -I lib -r dashboarder
|
22
|
+
$ LIBRATO_EMAIL=me@example.co LIBRATO_KEY=123456 irb -r dashboarder
|
15
23
|
```
|
16
24
|
|
17
25
|
```ruby
|
@@ -29,6 +37,10 @@ $ bundle exec irb -I lib -r dashboarder
|
|
29
37
|
# compose an individual instrument
|
30
38
|
# will not overwrite if already exists
|
31
39
|
Dashboarder::Instrument.compose(['my instrument', :first_metric, :second_metric])
|
40
|
+
|
41
|
+
# If an instrument has already been defined, you can compose
|
42
|
+
# like so:
|
43
|
+
Dashboarder::Dashboard.compose([:my_dashboard, :some_instrument, :some_other_instrument])
|
32
44
|
```
|
33
45
|
|
34
46
|
## Contributing
|
@@ -13,13 +13,20 @@ module Dashboarder
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.compose(definition)
|
16
|
-
|
17
|
-
|
16
|
+
# if we passed an atom, attempt to fetch rather than build
|
17
|
+
if definition.kind_of?(String) || definition.kind_of?(Symbol)
|
18
|
+
instrument = get(definition)
|
19
|
+
raise "instrument #{definition} has not been created yet" unless instrument
|
20
|
+
instrument
|
21
|
+
else
|
22
|
+
name = definition.first
|
23
|
+
instrument = get(name)
|
18
24
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
25
|
+
unless instrument
|
26
|
+
instrument = compose!(definition)
|
27
|
+
end
|
28
|
+
instrument
|
29
|
+
end
|
23
30
|
end
|
24
31
|
end
|
25
32
|
end
|
data/lib/dashboarder/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dashboarder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-11-21 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
16
|
-
requirement: &
|
16
|
+
requirement: &70262015999380 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70262015999380
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: excon
|
27
|
-
requirement: &
|
27
|
+
requirement: &70262015998380 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70262015998380
|
36
36
|
description: a lightweight composer for librato instruments and dashboards
|
37
37
|
email:
|
38
38
|
- michael.gorsuch@gmail.com
|