metrify 0.2.4 → 0.3.0
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.rdoc +4 -2
- data/lib/metrify.rb +0 -1
- metadata +5 -5
data/README.rdoc
CHANGED
|
@@ -17,7 +17,7 @@ To add the ability for a class to generate aggregated statistics over time, perf
|
|
|
17
17
|
1. Create .yml file defining metrics, and optional metric grouping filters
|
|
18
18
|
2. Include module functionality in class that will calculate metrics, and provide a method for each metric to be calulated.
|
|
19
19
|
|
|
20
|
-
You can create multiple classes that use this module. By default, the YML file loaded for the class will be on /config
|
|
20
|
+
You can create multiple classes that use this module. By default, the YML file loaded for the class will be on /config/(classname)_metrify.yml. Otherwise, specify the filename as an argument when calling "acts_as_metrify" within the class (shown below). RAILS_ROOT will be prepended.
|
|
21
21
|
|
|
22
22
|
Example YML file:
|
|
23
23
|
|
|
@@ -36,6 +36,8 @@ Example YML file:
|
|
|
36
36
|
element_dog_count:
|
|
37
37
|
display_name: Dog Count
|
|
38
38
|
|
|
39
|
+
stat_order: [element_a_count, element_b_count, element_1_count, element_dog_count, element_cat_count]
|
|
40
|
+
|
|
39
41
|
filters:
|
|
40
42
|
type:
|
|
41
43
|
numbers:
|
|
@@ -97,7 +99,7 @@ This will grant the following functionality to the MetricsClass defined above:
|
|
|
97
99
|
@metrics_class_instance.value_type('element_a_count') # => currency - returns type of value (currently only currency). This is useful for knowing how to display
|
|
98
100
|
@metrics_class_instance.show_variance('element_a_count') # => true - whether or not this value's % +/- change over last time period should be displayed
|
|
99
101
|
@metrics_class_instance.value_precision('element_a_count') # if specified in YML file, will round floats using provided precision
|
|
100
|
-
|
|
102
|
+
@metrics_class_instance.sort_stat_names(['element_dog_count', 'element_cat_count', 'element_b_count']) # => ['element_b_count', 'element_dog_count', 'element_cat_count'] ordered as defined by stat_order in yml, alphabetical if not configured
|
|
101
103
|
== Using with Highcharts for instant views
|
|
102
104
|
|
|
103
105
|
Assuming your application is configured to use Highcharts, optional controller, view, and helper components are included to provide charts with filters. To use:
|
data/lib/metrify.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metrify
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 19
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
version: 0.
|
|
8
|
+
- 3
|
|
9
|
+
- 0
|
|
10
|
+
version: 0.3.0
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Stephen Abrams
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2010-11-
|
|
18
|
+
date: 2010-11-15 00:00:00 -05:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|