td-logger 0.3.22 → 0.3.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d56c1c7474afbeaf21ac6d5cb67c92be9e17d0f0
4
+ data.tar.gz: d896adedf865360212fa5c863a0750a856ac72c4
5
+ SHA512:
6
+ metadata.gz: dc7fb69a448f4df5c51b89a95070b2815d32c09290cd072fda2f7eabfcfa536c91e6bf0875f2efdb3bb925bfe7884a5fcc7b19004628a4f35b1d3e67f9dd9058
7
+ data.tar.gz: 1cf6fbc1329f5545f22e35a628f3d290416cb12a4651b484239c7324e235365e21c24cfb85ad81ac953bce75b2d19cd61c4d2de553d465f436bd9a6d0e2ff5ef
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ == 2013-09-20 version 0.3.23
2
+
3
+ * Add TreasureDataLogger#flush to flush stored events immediatedly
4
+
5
+
1
6
  == 2013-08-02 version 0.3.22
2
7
 
3
8
  * Support Rails 4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.22
1
+ 0.3.23
@@ -98,6 +98,25 @@ class TreasureDataLogger < Fluent::Logger::LoggerBase
98
98
  end
99
99
  end
100
100
 
101
+ def flush
102
+ @mutex.lock
103
+
104
+ # Move small chunks into queue to flush all events.
105
+ # See try_flush routine for more detail
106
+ @map.reject! {|(db,table),buffer|
107
+ data = buffer.flush!
108
+ @queue << [db, table, data]
109
+ }
110
+ try_flush
111
+ rescue => e
112
+ @logger.error "Unexpected error at flush: #{e}"
113
+ e.backtrace.each {|bt|
114
+ @logger.info bt
115
+ }
116
+ ensure
117
+ @mutex.unlock
118
+ end
119
+
101
120
  def post_with_time(tag, record, time)
102
121
  @logger.debug { "event: #{tag} #{record.to_json}" rescue nil }
103
122
 
@@ -1,7 +1,7 @@
1
1
  module TreasureData
2
2
  module Logger
3
3
 
4
- VERSION = '0.3.22'
4
+ VERSION = '0.3.23'
5
5
 
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,34 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: td-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.22
5
- prerelease:
4
+ version: 0.3.23
6
5
  platform: ruby
7
6
  authors:
8
7
  - Sadayuki Furuhashi
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-02 00:00:00.000000000 Z
11
+ date: 2013-09-19 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: msgpack
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.4.4
22
- - - ! '!='
20
+ - - '!='
23
21
  - !ruby/object:Gem::Version
24
22
  version: 0.5.0
25
- - - ! '!='
23
+ - - '!='
26
24
  - !ruby/object:Gem::Version
27
25
  version: 0.5.1
28
- - - ! '!='
26
+ - - '!='
29
27
  - !ruby/object:Gem::Version
30
28
  version: 0.5.2
31
- - - ! '!='
29
+ - - '!='
32
30
  - !ruby/object:Gem::Version
33
31
  version: 0.5.3
34
32
  - - <
@@ -37,21 +35,20 @@ dependencies:
37
35
  type: :runtime
38
36
  prerelease: false
39
37
  version_requirements: !ruby/object:Gem::Requirement
40
- none: false
41
38
  requirements:
42
- - - ! '>='
39
+ - - '>='
43
40
  - !ruby/object:Gem::Version
44
41
  version: 0.4.4
45
- - - ! '!='
42
+ - - '!='
46
43
  - !ruby/object:Gem::Version
47
44
  version: 0.5.0
48
- - - ! '!='
45
+ - - '!='
49
46
  - !ruby/object:Gem::Version
50
47
  version: 0.5.1
51
- - - ! '!='
48
+ - - '!='
52
49
  - !ruby/object:Gem::Version
53
50
  version: 0.5.2
54
- - - ! '!='
51
+ - - '!='
55
52
  - !ruby/object:Gem::Version
56
53
  version: 0.5.3
57
54
  - - <
@@ -60,7 +57,6 @@ dependencies:
60
57
  - !ruby/object:Gem::Dependency
61
58
  name: td-client
62
59
  requirement: !ruby/object:Gem::Requirement
63
- none: false
64
60
  requirements:
65
61
  - - ~>
66
62
  - !ruby/object:Gem::Version
@@ -68,7 +64,6 @@ dependencies:
68
64
  type: :runtime
69
65
  prerelease: false
70
66
  version_requirements: !ruby/object:Gem::Requirement
71
- none: false
72
67
  requirements:
73
68
  - - ~>
74
69
  - !ruby/object:Gem::Version
@@ -76,7 +71,6 @@ dependencies:
76
71
  - !ruby/object:Gem::Dependency
77
72
  name: fluent-logger
78
73
  requirement: !ruby/object:Gem::Requirement
79
- none: false
80
74
  requirements:
81
75
  - - ~>
82
76
  - !ruby/object:Gem::Version
@@ -84,7 +78,6 @@ dependencies:
84
78
  type: :runtime
85
79
  prerelease: false
86
80
  version_requirements: !ruby/object:Gem::Requirement
87
- none: false
88
81
  requirements:
89
82
  - - ~>
90
83
  - !ruby/object:Gem::Version
@@ -92,33 +85,29 @@ dependencies:
92
85
  - !ruby/object:Gem::Dependency
93
86
  name: rake
94
87
  requirement: !ruby/object:Gem::Requirement
95
- none: false
96
88
  requirements:
97
- - - ! '>='
89
+ - - '>='
98
90
  - !ruby/object:Gem::Version
99
91
  version: 0.9.2
100
92
  type: :development
101
93
  prerelease: false
102
94
  version_requirements: !ruby/object:Gem::Requirement
103
- none: false
104
95
  requirements:
105
- - - ! '>='
96
+ - - '>='
106
97
  - !ruby/object:Gem::Version
107
98
  version: 0.9.2
108
99
  - !ruby/object:Gem::Dependency
109
100
  name: rspec
110
101
  requirement: !ruby/object:Gem::Requirement
111
- none: false
112
102
  requirements:
113
- - - ! '>='
103
+ - - '>='
114
104
  - !ruby/object:Gem::Version
115
105
  version: 2.7.0
116
106
  type: :development
117
107
  prerelease: false
118
108
  version_requirements: !ruby/object:Gem::Requirement
119
- none: false
120
109
  requirements:
121
- - - ! '>='
110
+ - - '>='
122
111
  - !ruby/object:Gem::Version
123
112
  version: 2.7.0
124
113
  description: Treasure Data logging library for Rails
@@ -151,33 +140,26 @@ files:
151
140
  - td-logger.gemspec
152
141
  homepage:
153
142
  licenses: []
143
+ metadata: {}
154
144
  post_install_message:
155
145
  rdoc_options: []
156
146
  require_paths:
157
147
  - lib
158
148
  required_ruby_version: !ruby/object:Gem::Requirement
159
- none: false
160
149
  requirements:
161
- - - ! '>='
150
+ - - '>='
162
151
  - !ruby/object:Gem::Version
163
152
  version: '0'
164
- segments:
165
- - 0
166
- hash: -690840558005483191
167
153
  required_rubygems_version: !ruby/object:Gem::Requirement
168
- none: false
169
154
  requirements:
170
- - - ! '>='
155
+ - - '>='
171
156
  - !ruby/object:Gem::Version
172
157
  version: '0'
173
- segments:
174
- - 0
175
- hash: -690840558005483191
176
158
  requirements: []
177
159
  rubyforge_project:
178
- rubygems_version: 1.8.23
160
+ rubygems_version: 2.0.2
179
161
  signing_key:
180
- specification_version: 3
162
+ specification_version: 4
181
163
  summary: Treasure Data logging library for Rails
182
164
  test_files:
183
165
  - spec/event_spec.rb