appsignal 1.2.0.alpha.3 → 1.2.0.alpha.4

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: 37ce7a608d4c05aca6924e338f6c40fad52f4ae3
4
- data.tar.gz: 63cb650e05a4a77088aee56f7382faa5844620aa
3
+ metadata.gz: e2ff73e89a8b3eb74dd286291bc97bed89436b27
4
+ data.tar.gz: 0d94e85529cec5b6542ee31b59ba91402ad741cd
5
5
  SHA512:
6
- metadata.gz: ea0336e1283562830aff2934ac941be1b5b23c17c18b9e38c39b67b2853c485e1b2cd3ece759df2373d1d954e8fa436168421c548a62d8ce4ccad07eb0f782b7
7
- data.tar.gz: 02e5f376610e448a59e5bc3d0f01dcbc97918a77e9e0b46d972efaedcbe4c29941c76ccb7e90b61513f31d84061974426e2b55f5c70467d32c868fa5d6d354a2
6
+ metadata.gz: 489c2779aa02038bde3bda1f3234f84d20ffd13abbf3c995247462c574e641cddcbbd2e2b68720560bd77d66d8a875043c795feb1aa90f555f26d419513808a2
7
+ data.tar.gz: 343e5893974f367981fe483b8304b3ae6974abea8078d1c3c1be290749f2a0e6d071060a3d0bf21d39b960c31509c239d4792b0c6963f17c270f85c5455eb266
@@ -3,6 +3,13 @@
3
3
  * Beta version of collecting host metrics (disabled by default)
4
4
  * Hooks for Shuryoken
5
5
 
6
+ # 1.1.9
7
+ * Fix for race condition when creating working dir exactly at the same time
8
+ * Make diag Rake task resilient to missing config
9
+
10
+ # 1.1.8
11
+ * Require json to fix problem with using from Capistrano
12
+
6
13
  # 1.1.7
7
14
  * Make logging resilient for closing FD's (daemons gem does this)
8
15
  * Add support for using Resque through ActiveJob
@@ -1,19 +1,15 @@
1
1
  ---
2
- version: b9b98f1
2
+ version: c5f733e
3
3
  triples:
4
4
  x86_64-linux:
5
- checksum: 69542d576478984d769257fb58639728a937872d35d3f9bb30da986e02d36909
6
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/b9b98f1/appsignal-agent-x86_64-linux-static.tar.gz
7
- lib_filename: libappsignal.a
5
+ checksum: 222b6eeb2a356439b2f16fbee7693f028f8fc9ab8ba7aebae98ec6fdb7ab78b1
6
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/c5f733e/appsignal-x86_64-linux-all-static.tar.gz
8
7
  i686-linux:
9
- checksum: 7bf25f151a255227c8bee0b75b8e8c75adc484f2b418c2dfc760e0a82869ed27
10
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/b9b98f1/appsignal-agent-i686-linux-static.tar.gz
11
- lib_filename: libappsignal.a
8
+ checksum: 5989723aa1ace7005e5bfdcde2703532362d17cfde39cec9c2969f5136eb65fa
9
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/c5f733e/appsignal-i686-linux-all-static.tar.gz
12
10
  x86-linux:
13
- checksum: 7bf25f151a255227c8bee0b75b8e8c75adc484f2b418c2dfc760e0a82869ed27
14
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/b9b98f1/appsignal-agent-i686-linux-static.tar.gz
15
- lib_filename: libappsignal.a
11
+ checksum: 5989723aa1ace7005e5bfdcde2703532362d17cfde39cec9c2969f5136eb65fa
12
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/c5f733e/appsignal-i686-linux-all-static.tar.gz
16
13
  x86_64-darwin:
17
- checksum: c8b0df3b38e9747d468e12bb7d7c6bfdc901b62d6138b5629c3969e78ff6cc4d
18
- download_url: https://appsignal-agent-releases.global.ssl.fastly.net/b9b98f1/appsignal-agent-x86_64-darwin-static.tar.gz
19
- lib_filename: libappsignal.a
14
+ checksum: 81bb1d29e9d13394f45d3634b9a53c2eb4f4bfcebfbe7b6178dd7c6295a28e99
15
+ download_url: https://appsignal-agent-releases.global.ssl.fastly.net/c5f733e/appsignal-x86_64-darwin-all-static.tar.gz
@@ -17,10 +17,23 @@ static VALUE stop(VALUE self) {
17
17
  return Qnil;
18
18
  }
19
19
 
20
+ static VALUE get_server_state(VALUE self, VALUE key) {
21
+ char * ptr = appsignal_get_server_state(StringValueCStr(key));
22
+
23
+ Check_Type(key, T_STRING);
24
+
25
+ if (ptr) {
26
+ return rb_str_new2(ptr);
27
+ } else {
28
+ return Qnil;
29
+ }
30
+ }
31
+
20
32
  static VALUE start_transaction(VALUE self, VALUE transaction_id, VALUE namespace) {
21
33
  appsignal_transaction* transaction;
22
34
 
23
35
  Check_Type(transaction_id, T_STRING);
36
+ Check_Type(namespace, T_STRING);
24
37
 
25
38
  transaction = appsignal_start_transaction(
26
39
  StringValueCStr(transaction_id),
@@ -242,6 +255,9 @@ void Init_appsignal_extension(void) {
242
255
  rb_define_singleton_method(Extension, "start", start, 0);
243
256
  rb_define_singleton_method(Extension, "stop", stop, 0);
244
257
 
258
+ // Server state
259
+ rb_define_singleton_method(Extension, "get_server_state", get_server_state, 1);
260
+
245
261
  // Start transaction
246
262
  rb_define_singleton_method(Extension, "start_transaction", start_transaction, 2);
247
263
 
@@ -85,6 +85,10 @@ module Appsignal
85
85
  @subscriber.resubscribe
86
86
  end
87
87
 
88
+ def get_server_state(key)
89
+ Appsignal::Extension::get_server_state(key)
90
+ end
91
+
88
92
  # Wrap a transaction with appsignal monitoring.
89
93
  def monitor_transaction(name, env={})
90
94
  unless active?
@@ -172,7 +172,7 @@ module Appsignal
172
172
  %w(APPSIGNAL_ACTIVE APPSIGNAL_DEBUG APPSIGNAL_INSTRUMENT_NET_HTTP
173
173
  APPSIGNAL_SKIP_SESSION_DATA APPSIGNAL_ENABLE_FRONTEND_ERROR_CATCHING
174
174
  APPSIGNAL_ENABLE_ALLOCATION_TRACKING APPSIGNAL_ENABLE_GC_INSTRUMENTATION
175
- APPSIGNAL_RUNNING_IN_CONTAINER).each do |var|
175
+ APPSIGNAL_RUNNING_IN_CONTAINER APPSIGNAL_COLLECT_HOST_METRICS).each do |var|
176
176
  if env_var = ENV[var]
177
177
  config[ENV_TO_KEY_MAPPING[var]] = env_var == 'true'
178
178
  end
@@ -1,3 +1,5 @@
1
+ require 'json'
2
+
1
3
  module Appsignal
2
4
  class Transaction
3
5
  HTTP_REQUEST = 'http_request'.freeze
@@ -14,7 +16,8 @@ module Appsignal
14
16
  HTTP_X_QUEUE_TIME HTTP_X_HEROKU_QUEUE_WAIT_TIME HTTP_X_APPLICATION_START
15
17
  HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ACCEPT_ENCODING HTTP_ACCEPT_LANGUAGE
16
18
  HTTP_CACHE_CONTROL HTTP_CONNECTION HTTP_USER_AGENT HTTP_FROM HTTP_NEGOTIATE
17
- HTTP_PRAGMA HTTP_REFERER HTTP_X_FORWARDED_FOR HTTP_CLIENT_IP HTTP_RANGE)
19
+ HTTP_PRAGMA HTTP_REFERER HTTP_X_FORWARDED_FOR HTTP_CLIENT_IP HTTP_RANGE
20
+ HTTP_X_AUTH_TOKEN)
18
21
 
19
22
  JSON_EXCEPTIONS = [
20
23
  IOError,
@@ -1,5 +1,5 @@
1
1
  require 'yaml'
2
2
 
3
3
  module Appsignal
4
- VERSION = '1.2.0.alpha.3'
4
+ VERSION = '1.2.0.alpha.4'
5
5
  end
@@ -20,8 +20,12 @@ namespace :appsignal do
20
20
 
21
21
  desc "Checks if config is present and shows the values"
22
22
  task :config => :start_appsignal do
23
- Appsignal.config.config_hash.each do |key, val|
24
- puts "Config #{key}: #{val}"
23
+ if Appsignal.config && Appsignal.config.config_hash
24
+ Appsignal.config.config_hash.each do |key, val|
25
+ puts "Config #{key}: #{val}"
26
+ end
27
+ else
28
+ puts "No config present"
25
29
  end
26
30
  end
27
31
 
@@ -204,6 +204,18 @@ describe Appsignal do
204
204
  end
205
205
  end
206
206
 
207
+ describe ".get_server_state" do
208
+ it "should call server state on the extension" do
209
+ Appsignal::Extension.should_receive(:get_server_state).with('key')
210
+
211
+ Appsignal.get_server_state('key')
212
+ end
213
+
214
+ it "should get nil by default" do
215
+ Appsignal.get_server_state('key').should be_nil
216
+ end
217
+ end
218
+
207
219
  context "not active" do
208
220
  describe ".monitor_transaction" do
209
221
  it "should do nothing but still yield the block" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.alpha.3
4
+ version: 1.2.0.alpha.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-31 00:00:00.000000000 Z
12
+ date: 2016-06-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack