gitlab-fluent-plugin-redis-slowlog 0.0.1 → 0.0.2

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
  SHA256:
3
- metadata.gz: 849d65a25ba670f60d324188cb543a9b5b618cde5683d27e95cecd862290bddc
4
- data.tar.gz: 12557c95bfd6029bbe899c826dad3038e7d285e3b5fe1b7d0747a200d91319bc
3
+ metadata.gz: 2c29fe816731c72b94242e6ea8debf36746f08f6f6d750b88eb95dcab727a006
4
+ data.tar.gz: 26792f5c673c1a6ea403e52b0be1473e94802564f3ec2298897348cd3bc5c863
5
5
  SHA512:
6
- metadata.gz: e79d5c3a510092ce501cd67294eb2faaa4edd333bfb706d9508e2a3a8917d861ab6e87eeb1f4cf04e9d3d0698159911e1462e745258bc726a1881c2f9f62ba35
7
- data.tar.gz: b4c8d26df8598d9700168b1eccf0316db60b3ca5864339c4c72bd927124180174d6de9c2723bd569702cdc7386ebde74bce9b7d54a5d02cf37dcaace20d152f6
6
+ metadata.gz: a5021486e250895773ffcfb3740cde86fc39cd909f0de98f85069c6592bcb383fd8382256639fa13a5492f5ee8def005197ba3e7e71dafd1e3452543c31b466e
7
+ data.tar.gz: 163fdfbbb4461a6fbe78558aa8930a030077fd459bcdc2bcfdc114cf27cf34e247d25192707f104d24bb70e5a55e7c6cb6573c7c65a2da910bce8f4665d90b1b
@@ -82,7 +82,7 @@ module Fluent
82
82
  next if log.first <= current_log_id
83
83
 
84
84
  log_hash = { "id" => log[0],
85
- "timestamp" => Time.at(log[1]),
85
+ "timestamp" => log[1].to_i,
86
86
  "exec_time" => log[2],
87
87
  "command" => log[3] }
88
88
  router.emit(tag, Time.now.to_i, log_hash)
@@ -108,12 +108,18 @@ describe Fluent::Plugin::RedisSlowlogInput do
108
108
  expect(driver.events.size).to eq(3)
109
109
  expect(emitted_entries).to eq(expected_entries)
110
110
  end
111
+
112
+ it "emits results that can be streamed to fluent using MessagePack" do
113
+ driver.run(expect_emits: 3)
114
+
115
+ expect { driver.events.map(&:to_msgpack) }.not_to raise_error
116
+ end
111
117
  end
112
118
  end
113
119
 
114
120
  def log_entry(slowlog_entry)
115
121
  { "id" => slowlog_entry.first,
116
- "timestamp" => Time.at(slowlog_entry[1]),
122
+ "timestamp" => slowlog_entry[1].to_i,
117
123
  "exec_time" => slowlog_entry[2],
118
124
  "command" => slowlog_entry.last }
119
125
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-fluent-plugin-redis-slowlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Van Landuyt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-04 00:00:00.000000000 Z
11
+ date: 2020-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler