metrify 0.2.0 → 0.2.1
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 +23 -1
- metadata +3 -3
data/README.rdoc
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
= metrify
|
|
2
2
|
|
|
3
|
-
Via the creation of a YAML file specifying statistics to track, and an extension class to specify the way to find those statistics, Metrify provides an easy way to aggregate and display statistics over time.
|
|
3
|
+
Via the creation of a YAML file specifying statistics to track, and an extension class to specify the way to find those statistics, Metrify provides an easy way to aggregate and display statistics over time. The minimal unit of aggregation is 1 day.
|
|
4
4
|
|
|
5
5
|
If Highcharts is used in your project, functionality is included to immediately use a default chart.
|
|
6
6
|
|
|
@@ -65,6 +65,28 @@ Example Class, implementing calculation methods for metrics defined in YML file:
|
|
|
65
65
|
end
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
+
The class will need the minimal columns defined in this example migration:
|
|
69
|
+
|
|
70
|
+
create_table :metrics_class, :force => true do |t|
|
|
71
|
+
t.date :finish_date
|
|
72
|
+
t.integer :number_of_days
|
|
73
|
+
t.string :stat_hash
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
This will grant the following functionality to the MetricsClass defined above:
|
|
77
|
+
|
|
78
|
+
@site_stat.element_a_count_name # => "Element A Count"
|
|
79
|
+
|
|
80
|
+
example_finish_date = Date::strptime('20/10/2010', '%d/%m/%Y')
|
|
81
|
+
number_of_days = 7
|
|
82
|
+
historical_values = @metrics_class_instance.historical_values(example_finish_date, 10, :day) # => returns array of 10 aggregations, each over 1 day, older values listed first, ended at the most recent aggregation date (example_finish_date). (:day, :month options)
|
|
83
|
+
historical_values[0].element_a_count # => generated for the given time frame using the 'element_a_count' method implemented in MetricsClass
|
|
84
|
+
|
|
85
|
+
@metrics_class_instance.stat_names # => stat names available, provided in YML file
|
|
86
|
+
|
|
87
|
+
filters = {'type' => ['numbers', 'letters'], 'furriness' => ['furry', 'not_furry']}
|
|
88
|
+
@metrics_class_instance.stat_names(filters) # => return only stat names available from filters
|
|
89
|
+
|
|
68
90
|
== Using with Highcharts for instant views
|
|
69
91
|
|
|
70
92
|
Assuming your application is configured to use Highcharts, optional controller, view, and helper components are included to provide charts with filters. To use:
|
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: 21
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 2
|
|
9
|
-
-
|
|
10
|
-
version: 0.2.
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.2.1
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Stephen Abrams
|