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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c8a85fd85634ae33591a952d1a9833d6b2a7e828b36a366c5811f5d9116e901
4
- data.tar.gz: 1bf462f1c2d14b015a2b52fc3dd510fad3fa642a14eb4b16f1aecca293bd25f7
3
+ metadata.gz: e445ae7019c027e5e0b9e18aeb36b6bb646c650175d32389dee1cfafe2a274bc
4
+ data.tar.gz: d5868c15d2844076b6abea3ce55c90e10183cfba812116bc95293a26f09dfad5
5
5
  SHA512:
6
- metadata.gz: 530ecf5853ada4749b8c7f0e14a1faa7bd37a5af3221082f3b00bca1f078a8c49e1fa55543f97183709207f5021a946333f8f7ccc91842781602fb1139418781
7
- data.tar.gz: 57c299275b25b447378a3c73352082f171f75805183ed00f7ac2ba4ad7cbf2fe6a78dc1c5e4627ee40a7241177b8413f190d624e2a3b175a87446e66c68472a3
6
+ metadata.gz: 77fe20eda7fe120cbe7a4ff6b295cc5e5229a3f08be1373c9a4b5196a9dd355d48932acc157999ce1f4e8af777938054412bb3de9af2cd6bcf4ddca23058e8d4
7
+ data.tar.gz: a3c1627c60684229f7aae7379910d8ef21799ed7e05923e86cca819d7a77f4c85a43f31c003713dcafd84694d60fd474f084d7329ebaae0330a7f43c27c3508b
@@ -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
- **🚧 NB:** The current version of the agent is `1.0.0.beta1`. This means we're really close to `1.0.0`. The API is stable and the only remaining thing to do is testing. Thank you if you've already been testing the agent!
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
 
@@ -51,7 +51,7 @@ def do_bench(transaction_count: 10, **config)
51
51
  end
52
52
  end
53
53
 
54
- transaction_count = Integer(ARGV.shift || 10)
54
+ transaction_count = Integer(ARGV.shift || 10_000)
55
55
 
56
56
  banner 'Default settings'
57
57
  do_bench transaction_count: transaction_count
@@ -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
- @missing_key_block = block
10
+ @mutex = Mutex.new
11
11
  end
12
12
 
13
13
  def [](key)
14
- found = true
15
- value = @data.delete(key) { found = false }
16
-
17
- if found
18
- @data[key] = value
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
- @data.delete(key)
26
- @data[key] = val
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ElasticAPM
4
- VERSION = '1.0.0'.freeze
4
+ VERSION = '1.0.1'.freeze
5
5
  end
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.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-06-29 00:00:00.000000000 Z
11
+ date: 2018-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby