crusher 0.0.5 → 0.0.6
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/lib/crusher/load_generator.rb +7 -5
- metadata +5 -4
@@ -25,15 +25,17 @@ module Crusher
|
|
25
25
|
|
26
26
|
def log_stats(event_type, data)
|
27
27
|
keys, values = data.map{|k,v| [k.to_s,v.to_s] }.transpose
|
28
|
-
stats_log_file(event_type)
|
28
|
+
stats_log_file(event_type) do |file|
|
29
|
+
file.syswrite "#{Time.now.strftime('%Y-%m-%d %H:%M:%S')},#{values.join(',')}\n"
|
30
|
+
end
|
29
31
|
end
|
30
32
|
|
31
33
|
def stats_log_file(event_type)
|
32
34
|
event_type = event_type.to_sym
|
33
|
-
@
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
File.open(File.join(@options[:stats_log_dir], "#{event_type}.csv"), 'a') do |file|
|
36
|
+
yield file
|
37
|
+
end
|
38
|
+
end
|
37
39
|
end
|
38
40
|
|
39
41
|
end
|
metadata
CHANGED
@@ -1,22 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crusher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- phene
|
14
14
|
- thatothermitch
|
15
|
+
- scashin133
|
15
16
|
autorequire:
|
16
17
|
bindir: bin
|
17
18
|
cert_chain: []
|
18
19
|
|
19
|
-
date: 2010-
|
20
|
+
date: 2010-12-17 00:00:00 -08:00
|
20
21
|
default_executable:
|
21
22
|
dependencies:
|
22
23
|
- !ruby/object:Gem::Dependency
|