logasm 0.2.4 → 0.2.5

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: f4fb5320608a9281ac19839580efd95841f32aab
4
- data.tar.gz: 8430bbe0cbc2da45220dc0561ef930e89186d1bb
3
+ metadata.gz: 5d617fe6f30cdd7d5019618e9d4156d558539860
4
+ data.tar.gz: f24dfbacbc3c18d94839770304c5c7ccdf841dce
5
5
  SHA512:
6
- metadata.gz: 11bd6d3a0334fab84540705fccb166a50089de39874d6547ce91317ffe798e3d642f7e7f046c1c31a4a93211b3fb31a920e3bd2a9ee564c3f67bf530a97f0288
7
- data.tar.gz: 2886b7fd506e8da359889c313cf914d85b8083eff115673bf86d7781e2d0569a6a67967daf3ee0b4900b8285767fda433c6c2b64f8906625c5b9d827eb9b2450
6
+ metadata.gz: 902f38928193719f4c23f4297da8049aa785adcab3d6c4a1620d6a7f716cdd9b90b991567f24dceb51b5fd3dd0015d5559173b1d0ac3673b81f4a37b1f4e44e4
7
+ data.tar.gz: 66ad45f23be1dbb5c0e07cfa21222641149d48f7db3946f61ad5b32f59afafb4f6bdd5b0f7e80be563bbd9c2a8101721a4abefe71dbf15a7dde49ac6ee394da6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- logasm (0.2.4)
4
+ logasm (0.2.5)
5
5
  inflecto
6
6
 
7
7
  GEM
data/lib/logasm/utils.rb CHANGED
@@ -3,6 +3,7 @@ require 'socket'
3
3
  class Logasm
4
4
  module Utils
5
5
  HOST = ::Socket.gethostname
6
+ DECIMAL_FRACTION_OF_SECOND = 3
6
7
 
7
8
  # Build logstash json compatible event
8
9
  #
@@ -34,7 +35,7 @@ class Logasm
34
35
 
35
36
  def self.overwritable_params
36
37
  {
37
- :@timestamp => Time.now.utc.iso8601,
38
+ :@timestamp => Time.now.utc.iso8601(DECIMAL_FRACTION_OF_SECOND),
38
39
  host: HOST
39
40
  }
40
41
  end
data/logasm.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "logasm"
7
- gem.version = '0.2.4'
7
+ gem.version = '0.2.5'
8
8
  gem.authors = ["Salemove"]
9
9
  gem.email = ["support@salemove.com"]
10
10
  gem.description = %q{It's logasmic}
data/spec/utils_spec.rb CHANGED
@@ -8,6 +8,10 @@ describe Logasm::Utils do
8
8
  let(:level) { 'INFO' }
9
9
  let(:metadata) { {x: 'y'} }
10
10
 
11
+ before do
12
+ allow(Time).to receive(:now) { Time.utc(2015, 10, 11, 23, 10, 21, 123456) }
13
+ end
14
+
11
15
  context 'when service name is in correct format' do
12
16
  it 'includes it in the event as application' do
13
17
  expect(event[:application]).to eq('test_service')
@@ -27,7 +31,7 @@ describe Logasm::Utils do
27
31
  end
28
32
 
29
33
  it 'includes timestamp' do
30
- expect(event[:@timestamp]).to match(/\d{4}.*/)
34
+ expect(event[:@timestamp]).to eq('2015-10-11T23:10:21.123Z')
31
35
  end
32
36
 
33
37
  it 'includes the host' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logasm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salemove
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-09 00:00:00.000000000 Z
11
+ date: 2015-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inflecto