alephant-sequencer 1.2.3 → 2.0.0

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: 9d1efba3ebfd1802f62368d9e17a16cf83970392
4
- data.tar.gz: 11785502367253508d865b8a9b7f5a6343d814a9
3
+ metadata.gz: 4570103faf053dd8afeabdb9178b0778df846d3b
4
+ data.tar.gz: 659abaf0cbd4076ff51f243ef9a29196d2353463
5
5
  SHA512:
6
- metadata.gz: ccb17409c561ab6de92d4c017bfe51e781c48294c5c271a26907dcb97f65d31afbbaef14a7c542f50507eac9c8784b373a556c5236b942f0efd3b45d5cabe3d8
7
- data.tar.gz: 795d7aa2e9b90d0e042b9bda5666408448c03b2d2fc0c30155ac3d6b93e781a4e4104f5071ee09b896d55bf789a44ebbdf351ebd8ab21c4771b3af8e16277282
6
+ metadata.gz: edddb7427b92d890e8b60c062e3bbf6571257a7b18c9b33c41432f972e31a533e110f38ddcffdb49b6f9a58bf7f2c84f3d61149738a65579d88e6a018cee1ead
7
+ data.tar.gz: 8182c93059341e7c63be14c35c9577b8bd1f540b12a5fb5caa5e4275622ecf67e2ae3126025cc08cd8f20762a079454453cea25f9ac62215d8bca0b086b6f6b6
@@ -66,10 +66,24 @@ module Alephant
66
66
  })
67
67
  end
68
68
 
69
- logger.info("SequenceTable#update_sequence_id: with new value #{value} for #{ident} success!")
69
+ logger.info(
70
+ "event" => "SequenceIdUpdated",
71
+ "id" => ident,
72
+ "value" => value,
73
+ "method" => "#{self.class}#update_sequence_id"
74
+ )
70
75
  rescue AWS::DynamoDB::Errors::ConditionalCheckFailedException
71
76
  logger.metric "SequencerFailedConditionalChecks"
72
- logger.warn("SequenceTable#update_sequence_id: (Value to put: #{value}, existing: #{current_sequence}) #{ident} outdated!")
77
+ logger.error(
78
+ "event" => "DynamoDBConditionalCheckFailed",
79
+ "newSequenceValue" => value,
80
+ "currentSequenceValue" => current_sequence,
81
+ "id" => ident,
82
+ "class" => e.class,
83
+ "message" => e.message,
84
+ "backtrace" => e.backtrace.join("\n"),
85
+ "method" => "#{self.class}#update_sequence_id"
86
+ )
73
87
  end
74
88
  end
75
89
 
@@ -14,7 +14,13 @@ module Alephant
14
14
  @exists = exists?
15
15
  @jsonpath = sequence_path
16
16
  @ident = id
17
- logger.info("Sequencer#initialize: table: #{sequence_table}, jsonpath: #{sequence_path}, id: #{id}")
17
+ logger.info(
18
+ "event" => "SequencerInitialized",
19
+ "sequenceTable" => sequence_table,
20
+ "jsonPath" => sequence_path,
21
+ "id" => id,
22
+ "method" => "#{self.class}#initialize"
23
+ )
18
24
  end
19
25
 
20
26
  def sequential?(msg)
@@ -35,14 +41,24 @@ module Alephant
35
41
  set_last_seen(msg, last_seen_id)
36
42
  else
37
43
  logger.metric "SequencerNonSequentialMessageCount"
38
- logger.info("Sequencer#sequence nonsequential message for #{ident} (last_seen_id: #{last_seen_id})")
44
+ logger.info(
45
+ "event" => "NonSequentialMessageReceived",
46
+ "id" => ident,
47
+ "lastSeenId" => last_seen_id,
48
+ "method" => "#{self.class}#validate"
49
+ )
39
50
  end
40
51
  end
41
52
 
42
53
  def delete!
43
- logger.info("Sequencer#delete!: #{ident}")
44
54
  @exists = false
45
- @sequence_table.delete_item!(ident)
55
+ @sequence_table.delete_item!(ident).tap do
56
+ logger.info(
57
+ "event" => "SequenceIdDeleted",
58
+ "id" => ident,
59
+ "method" => "#{self.class}#delete!"
60
+ )
61
+ end
46
62
  end
47
63
 
48
64
  def truncate!
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Sequencer
3
- VERSION = "1.2.3"
3
+ VERSION = "2.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alephant-sequencer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BBC News
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-01 00:00:00.000000000 Z
11
+ date: 2015-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement