fnordmetric 1.2.7 → 1.2.9
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/fnordmetric.gemspec +1 -0
- data/lib/fnordmetric/gauge_modifiers.rb +1 -1
- data/lib/fnordmetric/version.rb +1 -1
- data/web/js/fnordmetric.util.js +0 -65
- metadata +3 -3
data/fnordmetric.gemspec
CHANGED
|
@@ -93,7 +93,7 @@ module FnordMetric::GaugeModifiers
|
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
ctx.redis_exec(:hincrby, retention_key(at, series_name), "#{tick_at(at)}-#{part}", value).callback do
|
|
96
|
-
ctx.redis_exec :expire, retention_key(at, series_name)
|
|
96
|
+
ctx.redis_exec :expire, retention_key(at, series_name), retention
|
|
97
97
|
end
|
|
98
98
|
end
|
|
99
99
|
|
data/lib/fnordmetric/version.rb
CHANGED
data/web/js/fnordmetric.util.js
CHANGED
|
@@ -2,10 +2,6 @@ FnordMetric.util.getNextWidgetUID = function(){
|
|
|
2
2
|
return (FnordMetric.currentWidgetUID += 1);
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
FnordMetric.util.decPrint = function(val){
|
|
6
|
-
return (val < 10 ? '0'+val : val);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
5
|
FnordMetric.util.formatTimeOfDay = function(_time){
|
|
10
6
|
if(_time === null) {
|
|
11
7
|
return "";
|
|
@@ -18,22 +14,6 @@ FnordMetric.util.formatTimeOfDay = function(_time){
|
|
|
18
14
|
}
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
FnordMetric.util.formatTimeRange = function(range){
|
|
22
|
-
if (range < 60){
|
|
23
|
-
return parseInt(range) + ' sec';
|
|
24
|
-
} else if(range<3600){
|
|
25
|
-
return parseInt(range/60) + ' min';
|
|
26
|
-
} else if(range==3600){
|
|
27
|
-
return '1 hour';
|
|
28
|
-
} else if(range<(3600*24)){
|
|
29
|
-
return parseInt(range/3600) + ' hours';
|
|
30
|
-
} else if(range==(3600*24)){
|
|
31
|
-
return '1 day';
|
|
32
|
-
} else {
|
|
33
|
-
return parseInt(range/(3600*24)) + ' days';
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
17
|
FnordMetric.util.formatTimeRangePre = function(range, offset){
|
|
38
18
|
if(!offset){ offset=0; } else { offset=parseInt(offset); }
|
|
39
19
|
if((offset == 0) && (range==(3600*24))){
|
|
@@ -80,42 +60,6 @@ FnordMetric.util.formatOffset = function(offset, next_offset){
|
|
|
80
60
|
}
|
|
81
61
|
}
|
|
82
62
|
|
|
83
|
-
FnordMetric.util.formatValue = function(value){
|
|
84
|
-
if(value < 10){
|
|
85
|
-
return value.toFixed(1);
|
|
86
|
-
}
|
|
87
|
-
if(value < 100){
|
|
88
|
-
return value.toFixed(1);
|
|
89
|
-
} else if(value > 1000){
|
|
90
|
-
return (value/1000.0).toFixed(1) + "k";
|
|
91
|
-
} else {
|
|
92
|
-
return value.toFixed(0);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
FnordMetric.util.formatTimeValue = function(value){
|
|
97
|
-
if (value < 60){
|
|
98
|
-
return parseFloat(value).toFixed(1) + 's';
|
|
99
|
-
} else if(value<3600){
|
|
100
|
-
return parseFloat(value/60).toFixed(1) + 'm';
|
|
101
|
-
} else if(value<(3600*24)){
|
|
102
|
-
return parseFloat(value/3600).toFixed(1) + 'h';
|
|
103
|
-
} else {
|
|
104
|
-
return parseFloat(value/(3600*24)).toFixed(1) + 'd';
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
FnordMetric.util.formatPercentValue = function(value){
|
|
109
|
-
value = parseFloat(value);
|
|
110
|
-
if(value < 10){
|
|
111
|
-
return value.toFixed(2) + '%';
|
|
112
|
-
} else if(value < 100){
|
|
113
|
-
return value.toFixed(1) + '%';
|
|
114
|
-
} else {
|
|
115
|
-
return '100%';
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
63
|
FnordMetric.util.formatGaugeValue = function(gauge_key, value){
|
|
120
64
|
if(!gauge_key){ gauge_key = ""; }
|
|
121
65
|
if(gauge_key.slice(0,8) === '__time__'){
|
|
@@ -160,15 +104,6 @@ FnordMetric.util.updateNumbers = function(trgt_elem, diff_factor, single){
|
|
|
160
104
|
}
|
|
161
105
|
}
|
|
162
106
|
|
|
163
|
-
FnordMetric.util.dateFormat = function(timestamp){
|
|
164
|
-
var t = new Date(timestamp*1000);
|
|
165
|
-
return FnordMetric.util.decPrint(t.getDate()) + "." +
|
|
166
|
-
FnordMetric.util.decPrint((t.getMonth()+1)) + "." +
|
|
167
|
-
FnordMetric.util.decPrint(t.getFullYear()) + " " +
|
|
168
|
-
FnordMetric.util.decPrint(t.getHours()) + ":" +
|
|
169
|
-
FnordMetric.util.decPrint(t.getMinutes()) + " ";
|
|
170
|
-
}
|
|
171
|
-
|
|
172
107
|
FnordMetric.util.format = function(elem){
|
|
173
108
|
$('.ui_trend, .ui_value', $(elem)).each(function(){
|
|
174
109
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fnordmetric
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.9
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-
|
|
12
|
+
date: 2013-06-25 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: sinatra
|
|
@@ -413,7 +413,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
413
413
|
version: '0'
|
|
414
414
|
requirements: []
|
|
415
415
|
rubyforge_project:
|
|
416
|
-
rubygems_version: 1.8.
|
|
416
|
+
rubygems_version: 1.8.25
|
|
417
417
|
signing_key:
|
|
418
418
|
specification_version: 3
|
|
419
419
|
summary: FnordMetric is a Ruby Event-Tracking gem on steroids
|