elastic-apm 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of elastic-apm might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -15
- data/bench/benchmark.rb +1 -1
- data/bench/report.rb +17 -5
- data/lib/elastic_apm/util/lru_cache.rb +20 -14
- data/lib/elastic_apm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e445ae7019c027e5e0b9e18aeb36b6bb646c650175d32389dee1cfafe2a274bc
|
4
|
+
data.tar.gz: d5868c15d2844076b6abea3ce55c90e10183cfba812116bc95293a26f09dfad5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77fe20eda7fe120cbe7a4ff6b295cc5e5229a3f08be1373c9a4b5196a9dd355d48932acc157999ce1f4e8af777938054412bb3de9af2cd6bcf4ddca23058e8d4
|
7
|
+
data.tar.gz: a3c1627c60684229f7aae7379910d8ef21799ed7e05923e86cca819d7a77f4c85a43f31c003713dcafd84694d60fd474f084d7329ebaae0330a7f43c27c3508b
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## Unreleased
|
8
|
+
|
9
|
+
|
10
|
+
## 1.0.1 (2018-07-30)
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
- Fixed internal LRU cache to be threadsafe ([#178](https://github.com/elastic/apm-agent-ruby/pulls/178))
|
15
|
+
|
7
16
|
## 1.0.0 (2018-06-29)
|
8
17
|
|
9
18
|
### Added
|
data/README.md
CHANGED
@@ -5,21 +5,7 @@
|
|
5
5
|
|
6
6
|
The official Rubygem for [Elastic][] [APM][].
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
To test the prerelease:
|
11
|
-
|
12
|
-
```sh
|
13
|
-
gem install elastic-apm --pre
|
14
|
-
```
|
15
|
-
|
16
|
-
or in your `Gemfile`:
|
17
|
-
|
18
|
-
```ruby
|
19
|
-
gem 'elastic-apm', '~> 1.0.0.beta1'
|
20
|
-
```
|
21
|
-
|
22
|
-
💡 We'd love to get feedback and information about you setup – please answer this [☑ short survey](https://goo.gl/forms/LQktvn4rkLWBNSWy1).
|
8
|
+
💡 We'd love to get feedback and information about your setup – please answer this [☑ short survey](https://goo.gl/forms/LQktvn4rkLWBNSWy1).
|
23
9
|
|
24
10
|
---
|
25
11
|
|
data/bench/benchmark.rb
CHANGED
data/bench/report.rb
CHANGED
@@ -12,6 +12,20 @@ ELASTICSEARCH_URL = ENV.fetch('CLOUD_ADDR') { '' }.chomp
|
|
12
12
|
if ELASTICSEARCH_URL == ''
|
13
13
|
puts 'ELASTICSEARCH_URL missing, exiting ...'
|
14
14
|
exit 1
|
15
|
+
else
|
16
|
+
# debug
|
17
|
+
# puts ELASTICSEARCH_URL.gsub(/:[^\/]+(.*)@/) { |m| ":#{Array.new(m.length - 2).map { '*' }.join}@" }
|
18
|
+
end
|
19
|
+
|
20
|
+
CONN = Faraday.new(url: ELASTICSEARCH_URL) do |f|
|
21
|
+
# f.response :logger
|
22
|
+
f.adapter Faraday.default_adapter
|
23
|
+
end
|
24
|
+
|
25
|
+
healthcheck = CONN.get('/microbenchmark*/_search')
|
26
|
+
if healthcheck.status != 200
|
27
|
+
puts healthcheck.body.to_s
|
28
|
+
exit 1
|
15
29
|
end
|
16
30
|
|
17
31
|
input = STDIN.read.split("\n")
|
@@ -22,6 +36,8 @@ counts = input.grep(/^Count: /).map { |a| a.gsub(/^Count: /, '').to_i }
|
|
22
36
|
averages = input.grep(/^avg/).map { |a| a.match(/\((.+)\)/)[1].to_f }
|
23
37
|
|
24
38
|
git_sha, git_date, git_msg = `git log -n 1 --pretty="format:%H|||%ai|||%s"`.split('|||')
|
39
|
+
git_date ||= Time.new.iso8601
|
40
|
+
git_branch = `git branch | grep '\*' | awk '{print $2}'`
|
25
41
|
platform = Gem::Platform.local
|
26
42
|
|
27
43
|
payloads = titles.zip(averages, counts).map do |(title, avg, count)|
|
@@ -33,6 +49,7 @@ payloads = titles.zip(averages, counts).map do |(title, avg, count)|
|
|
33
49
|
'git.commit' => git_sha,
|
34
50
|
'git.date' => Time.parse(git_date).iso8601,
|
35
51
|
'git.subject' => git_msg,
|
52
|
+
'git.branch' => git_branch,
|
36
53
|
hostname: `hostname`.chomp,
|
37
54
|
engine: RUBY_ENGINE,
|
38
55
|
arch: platform.cpu,
|
@@ -43,11 +60,6 @@ end
|
|
43
60
|
|
44
61
|
puts '=== Reporting to ES'
|
45
62
|
|
46
|
-
CONN = Faraday.new(url: ELASTICSEARCH_URL) do |f|
|
47
|
-
f.response :logger
|
48
|
-
f.adapter Faraday.default_adapter
|
49
|
-
end
|
50
|
-
|
51
63
|
payloads.each do |payload|
|
52
64
|
result = CONN.post('/benchmark-ruby/_doc') do |req|
|
53
65
|
req.headers['Content-Type'] = 'application/json'
|
@@ -7,27 +7,22 @@ module ElasticAPM
|
|
7
7
|
def initialize(max_size = 512, &block)
|
8
8
|
@max_size = max_size
|
9
9
|
@data = Hash.new(&block)
|
10
|
-
@
|
10
|
+
@mutex = Mutex.new
|
11
11
|
end
|
12
12
|
|
13
13
|
def [](key)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
else
|
20
|
-
@missing_key_block && @missing_key_block.call(self, key)
|
14
|
+
@mutex.synchronize do
|
15
|
+
val = @data[key]
|
16
|
+
return unless val
|
17
|
+
add(key, val)
|
18
|
+
val
|
21
19
|
end
|
22
20
|
end
|
23
21
|
|
24
22
|
def []=(key, val)
|
25
|
-
@
|
26
|
-
|
27
|
-
|
28
|
-
return unless @data.length > @max_size
|
29
|
-
|
30
|
-
@data.delete(@data.first[0])
|
23
|
+
@mutex.synchronize do
|
24
|
+
add(key, val)
|
25
|
+
end
|
31
26
|
end
|
32
27
|
|
33
28
|
def length
|
@@ -37,6 +32,17 @@ module ElasticAPM
|
|
37
32
|
def to_a
|
38
33
|
@data.to_a
|
39
34
|
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def add(key, val)
|
39
|
+
@data.delete(key)
|
40
|
+
@data[key] = val
|
41
|
+
|
42
|
+
return unless @data.length > @max_size
|
43
|
+
|
44
|
+
@data.delete(@data.first[0])
|
45
|
+
end
|
40
46
|
end
|
41
47
|
end
|
42
48
|
end
|
data/lib/elastic_apm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastic-apm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikkel Malmberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|