honeybadger 2.0.0.beta.12 → 2.0.0.beta.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/honeybadger/agent.rb +2 -1
- data/lib/honeybadger/agent/batch.rb +7 -7
- data/lib/honeybadger/agent/trace_collection.rb +32 -0
- data/lib/honeybadger/version.rb +1 -1
- metadata +16 -10
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
Njc3ZjA5YTRjZGExMjVlMmY1NmUxMmEwZjU1YjI5ZGNlNmQyNDA2MQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 232e0bbf08852f65acb4070361a6a7659ad7f796
|
4
|
+
data.tar.gz: 4ff2b16b4e49c00c2f606b7c59b725de46a7761b
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
MWQ2MzFmMDE4ZDk0Y2Q4MjI0MjJjOTRkMzAxNzQ0MDMzMzBmZWY3YzQ2NThj
|
11
|
-
YjYzM2I3NWZmMGNiZjA0N2Q3ODZmMjMyNDAyNzUzZWE1N2JmMWU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OTZmZTg0MjBhMmY0N2M3NWQ2YWJhMmNjZGI0NWFjOWJiYjFlNTE4ZjFhYWRh
|
14
|
-
MmZkZDZmMTlmZTIwMzcyMzRmYWVmZDk2NzFkODFjNmM5MjJkYzdiODljMDQ2
|
15
|
-
MzY4N2I4MGEzYmEzNjQxNWQzOGFmZjdiYzEzZmMxYTVkYzFlOTQ=
|
6
|
+
metadata.gz: 7ac9c7ee5f507c0ed7ed10974dcf74b023cd5764b5679ae58ea32e1fe02176832e07532a5cbbe8d089c485995493f5236c7dc94ca2340612bda8082fcd17dbdb
|
7
|
+
data.tar.gz: 5fddd42aaf01b18bdae5483b94221d81ff361e07d01d7867572d0c246108764f23aa065f296e28889183bed47b0675418459f93cdac1d5b7f87fb033cd49355a
|
data/lib/honeybadger/agent.rb
CHANGED
@@ -20,6 +20,7 @@ module Honeybadger
|
|
20
20
|
autoload :NullWorker, 'honeybadger/agent/worker'
|
21
21
|
autoload :Batch, 'honeybadger/agent/batch'
|
22
22
|
autoload :MetricsCollector, 'honeybadger/agent/metrics_collector'
|
23
|
+
autoload :TraceCollection, 'honeybadger/agent/trace_collection'
|
23
24
|
|
24
25
|
class << self
|
25
26
|
extend Forwardable
|
@@ -303,7 +304,7 @@ module Honeybadger
|
|
303
304
|
end
|
304
305
|
|
305
306
|
def init_traces
|
306
|
-
@traces = Batch.new(config, :traces, 20, config.debug? ? 10 : 60)
|
307
|
+
@traces = Batch.new(config, :traces, max: 20, interval: config.debug? ? 10 : 60, collection: TraceCollection.new)
|
307
308
|
end
|
308
309
|
|
309
310
|
def init_metrics
|
@@ -3,14 +3,14 @@ require 'securerandom'
|
|
3
3
|
module Honeybadger
|
4
4
|
class Agent
|
5
5
|
class Batch
|
6
|
-
def initialize(config, name
|
6
|
+
def initialize(config, name, opts = {})
|
7
7
|
@id = SecureRandom.uuid
|
8
8
|
@config = config
|
9
9
|
@name = name
|
10
|
-
@max = max
|
11
|
-
@interval = interval
|
12
|
-
@future = now + interval
|
13
|
-
@values = Array.new
|
10
|
+
@max = opts.fetch(:max, 100)
|
11
|
+
@interval = opts.fetch(:interval, 60)
|
12
|
+
@future = opts.fetch(:now, now()) + interval
|
13
|
+
@values = opts.fetch(:collection, Array.new)
|
14
14
|
@mutex = Mutex.new
|
15
15
|
end
|
16
16
|
|
@@ -34,13 +34,13 @@ module Honeybadger
|
|
34
34
|
|
35
35
|
def as_json(*args)
|
36
36
|
mutex.synchronize do
|
37
|
-
{ name => values.
|
37
|
+
{ name => values.map(&:to_h), :environment => config[:env], :hostname => config[:hostname] }
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
private
|
42
42
|
|
43
|
-
attr_reader :config, :name, :max, :values, :future, :mutex
|
43
|
+
attr_reader :config, :name, :max, :interval, :values, :future, :mutex
|
44
44
|
|
45
45
|
def now
|
46
46
|
Time.now.to_i
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
3
|
+
# Internal: A collection for de-duping traces. Not currently thread-safe (so
|
4
|
+
# make sure access is synchronized.)
|
5
|
+
module Honeybadger
|
6
|
+
class Agent
|
7
|
+
class TraceCollection
|
8
|
+
extend Forwardable
|
9
|
+
include Enumerable
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
@traces = {}
|
13
|
+
end
|
14
|
+
|
15
|
+
def_delegators :to_a, :each, :empty?, :size
|
16
|
+
|
17
|
+
def push(trace)
|
18
|
+
if !traces.key?(trace.key) || traces[trace.key].duration < trace.duration
|
19
|
+
traces[trace.key] = trace
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_a
|
24
|
+
traces.values
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
attr_reader :traces
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/honeybadger/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honeybadger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.beta.
|
4
|
+
version: 2.0.0.beta.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Honeybadger Industries LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Make managing application errors a more pleasant experience.
|
14
14
|
email:
|
@@ -28,6 +28,7 @@ files:
|
|
28
28
|
- lib/honeybadger/agent/metrics_collection.rb
|
29
29
|
- lib/honeybadger/agent/metrics_collector.rb
|
30
30
|
- lib/honeybadger/agent/null_worker.rb
|
31
|
+
- lib/honeybadger/agent/trace_collection.rb
|
31
32
|
- lib/honeybadger/agent/worker.rb
|
32
33
|
- lib/honeybadger/backend.rb
|
33
34
|
- lib/honeybadger/backend/base.rb
|
@@ -117,28 +118,33 @@ homepage: https://github.com/honeybadger-io/honeybadger-ruby
|
|
117
118
|
licenses:
|
118
119
|
- MIT
|
119
120
|
metadata: {}
|
120
|
-
post_install_message:
|
121
|
-
|
122
|
-
|
121
|
+
post_install_message: |2+
|
122
|
+
|
123
|
+
Thanks for installing honeybadger version 2.0! If you're upgrading from 1.x,
|
124
|
+
please note that there may be a few configuration changes required. Read the
|
125
|
+
upgrade instructions at:
|
126
|
+
|
127
|
+
https://www.honeybadger.io/s/gem-upgrade
|
128
|
+
|
123
129
|
rdoc_options:
|
124
|
-
- --markup=tomdoc
|
125
|
-
- --main=README.md
|
130
|
+
- "--markup=tomdoc"
|
131
|
+
- "--main=README.md"
|
126
132
|
require_paths:
|
127
133
|
- lib
|
128
134
|
- vendor/capistrano-honeybadger/lib
|
129
135
|
required_ruby_version: !ruby/object:Gem::Requirement
|
130
136
|
requirements:
|
131
|
-
- -
|
137
|
+
- - ">="
|
132
138
|
- !ruby/object:Gem::Version
|
133
139
|
version: 1.9.3
|
134
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
141
|
requirements:
|
136
|
-
- -
|
142
|
+
- - ">"
|
137
143
|
- !ruby/object:Gem::Version
|
138
144
|
version: 1.3.1
|
139
145
|
requirements: []
|
140
146
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.4.
|
147
|
+
rubygems_version: 2.4.5
|
142
148
|
signing_key:
|
143
149
|
specification_version: 4
|
144
150
|
summary: Error reports you can be happy about.
|