fluent-plugin-mixpanel 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce61d35f6244b42e741d6d7f3c783ab3ca163673
4
- data.tar.gz: c63f6f73b9cd17f02a1463d8bf8eccf490b4a29a
3
+ metadata.gz: 1f52ca8a3eeb5cf55c6edafa375a7ef3baa85129
4
+ data.tar.gz: f1ec985b547288ee38f281513e5c6b8945a7da60
5
5
  SHA512:
6
- metadata.gz: 13c356b9919ce45d9d0a9659193088f76c795bda5dc09228e8979d97954ea1b539bb9178f52c6af59850b5cd7302e3cd47d7000d0182ab2f93bcdbbb09fecca4
7
- data.tar.gz: 395b697c73e01b9d39a5dea0607fa4e9f75dbd11462e1b8032944d27f35b003699e5a3f33bc57454fe20c2f60e43b96eaee93aa6ffbd68623eb9cac248d03904
6
+ metadata.gz: f5bc26f5e50925291e9b46163d2b5c8e838221982441c65eea3f366820a3e199817679e2569c7dfb8f51e961d7543c0859269181f0d924ccd05dbc27511f48a4
7
+ data.tar.gz: 52e60e00116aa0668fc56c6a3dfe3971cd964e358800c5881acf1cc817cfe972158f60bf668350324f3375a299377410422c2b75674fc50f4ff8391db1b5f060
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-mixpanel"
7
- spec.version = "0.0.7"
7
+ spec.version = "0.0.8"
8
8
  spec.authors = ["Kazuyuki Honda"]
9
9
  spec.email = ["hakobera@gmail.com"]
10
10
  spec.summary = %q{Fluentd plugin to input/output event track data to mixpanel}
@@ -48,6 +48,7 @@ class Fluent::MixpanelOutput < Fluent::BufferedOutput
48
48
  end
49
49
 
50
50
  def format(tag, time, record)
51
+ time = record['time'] if record['time'] && @use_import
51
52
  [tag, time, record].to_msgpack
52
53
  end
53
54
 
@@ -82,6 +82,21 @@ class MixpanelOutputTest < Test::Unit::TestCase
82
82
  assert_equal "value2", @out[0]['properties']['key2']
83
83
  end
84
84
 
85
+ def test_write_setting_time_via_export
86
+ stub_mixpanel_import
87
+ d = create_driver(CONFIG + "use_import true\nevent_key event")
88
+ time = Time.new('2014-01-01T01:23:45+00:00')
89
+ d.emit(sample_record.merge!('time' => 1435707767), time)
90
+ d.run
91
+
92
+ assert_equal "test_token", @out[0]['properties']['token']
93
+ assert_equal "123", @out[0]['properties']['distinct_id']
94
+ assert_equal "event1", @out[0]['event']
95
+ assert_equal 1435707767, @out[0]['properties']['time']
96
+ assert_equal "value1", @out[0]['properties']['key1']
97
+ assert_equal "value2", @out[0]['properties']['key2']
98
+ end
99
+
85
100
  def test_write_multi_request
86
101
  stub_mixpanel_import
87
102
  d = create_driver(IMPORT_CONFIG + "event_key event")
@@ -219,8 +234,6 @@ class MixpanelOutputTest < Test::Unit::TestCase
219
234
  assert_equal "value2", @out[0]['properties']['key2']
220
235
  end
221
236
 
222
-
223
-
224
237
  def test_write_ignore_special_event
225
238
  stub_mixpanel
226
239
  d = create_driver(CONFIG + "event_key event")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-mixpanel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuyuki Honda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-09 00:00:00.000000000 Z
11
+ date: 2015-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd