api-harvester 0.0.4 → 0.0.5

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: 392f9d5ffb1d1ed01363aa11dbb1d297b4e49d17
4
- data.tar.gz: 8f9c3d9e5d2d87d2cb381ea4df527256c2c8a94c
3
+ metadata.gz: 0dee496aae3466c73f51a2076c3ed14aa470bb1f
4
+ data.tar.gz: df9838f62fdb2d6fde63152c3d576e4960650bcc
5
5
  SHA512:
6
- metadata.gz: 5c64c334957112dd5d9ddad0d4b77e315a2676677185087f49e385bd3b760511699702376540a19d50256b8d8bb7eb3ac23ee0ede7f455bac015116de70ce271
7
- data.tar.gz: aa6177229f062988cdfe041ff455f4fac8beb0b281e5fe518206b8f19da619a660031e0647a8c8e01ea16d817c217f273a097b67a2a36fb3c4add248897f80cc
6
+ metadata.gz: f30b3a6b4ea82f4ff7c784600a8a2f656d25efe21c99af3032658bfb2aec341bd933f97e31a8a6790f31c5e5684ab254f2861740585433b65dd540cd639d83fe
7
+ data.tar.gz: c0f734705a51eb07d80a9729bbd4f2ac66f89c471d4fa78115838fcf1cf13efe2da529789d4f95ad4fde66b3e4ee8cb2122a9f90ad929599637600a49c0443ec
@@ -3,7 +3,8 @@ require 'ezmq'
3
3
  require 'msgpack'
4
4
  require 'oj'
5
5
  require_relative 'settings'
6
- require_relative '../../key_transactions'
6
+ # require_relative '../../key_transactions'
7
+ Dir["../parser_functions/*.rb"].each {|file| require file }
7
8
  module Parser
8
9
  @broadcaster = EZMQ::Publisher.new :bind, port: 6000, encode: -> m { Oj.dump m }
9
10
  def self.activate topic, endpoint
@@ -0,0 +1,58 @@
1
+ #!/bin/env ruby
2
+ require 'pry'
3
+ def key_transactions incoming_data
4
+ outgoing_data = []
5
+ transactions = incoming_data['key_transactions']
6
+ transactions.each do |transaction|
7
+ transaction['application_summary'] = {} unless transaction['application_summary']
8
+ transaction['end_user_summary'] = {} unless transaction['end_user_summary']
9
+ plowed = {
10
+ "database_name": "NewRelic-transactions",
11
+ "series_name": transaction['name'],
12
+ "application-response_time": transaction['application_summary']['response_time'],
13
+ "application-throughput": transaction['application_summary']['throughput'],
14
+ "application-error_rate": transaction['application_summary']['error_rate'],
15
+ "application-apdex_target": transaction['application_summary']['apdex_target'],
16
+ "application-apdex_score": transaction['application_summary']['apdex_score'],
17
+ "application-host_count": transaction['application_summary']['host_count'],
18
+ "application-instance_count": transaction['application_summary']['instance_count'],
19
+ "application-concurrent_instance_count": transaction['application_summary']['concurrent_instance_count'],
20
+ "end_user-response_time": transaction['end_user_summary']['response_time'],
21
+ "end_user-throughput": transaction['end_user_summary']['throughput'],
22
+ "end_user-apdex_target": transaction['end_user_summary']['apdex_target'],
23
+ "end_user-apdex_score": transaction['end_user_summary']['apdex_score']
24
+ }
25
+ outgoing_data << plowed.keep_if {|_,value| !value.nil?}
26
+ end
27
+ outgoing_data
28
+ end
29
+
30
+ # {
31
+ # "key_transaction": {
32
+ # "id": "integer",
33
+ # "name": "string",
34
+ # "transaction_name": "string",
35
+ # "health_status": "string",
36
+ # "reporting": "boolean",
37
+ # "last_reported_at": "time",
38
+ # "application_summary": {
39
+ # "response_time": "float",
40
+ # "throughput": "float",
41
+ # "error_rate": "float",
42
+ # "apdex_target": "float",
43
+ # "apdex_score": "float",
44
+ # "host_count": "integer",
45
+ # "instance_count": "integer",
46
+ # "concurrent_instance_count": "integer"
47
+ # },
48
+ # "end_user_summary": {
49
+ # "response_time": "float",
50
+ # "throughput": "float",
51
+ # "apdex_target": "float",
52
+ # "apdex_score": "float"
53
+ # },
54
+ # "links": {
55
+ # "application": "integer"
56
+ # }
57
+ # }
58
+ # }
@@ -0,0 +1,62 @@
1
+ module Default
2
+
3
+
4
+ def self.puller name, endpoint, timeout
5
+ %Q(#!/bin/env ruby
6
+ require_relative '../lib/harvester/puller'
7
+ Puller.activate("#{name}", "#{endpoint}", #{timeout})
8
+ )
9
+ end
10
+
11
+ def self.parser name, endpoint
12
+ %Q(#!/bin/env ruby
13
+ require_relative '../lib/harvester/parser'
14
+ Parser.activate("#{name}", "#{endpoint}")
15
+ )
16
+ end
17
+
18
+ def self.pusher name, endpoint
19
+ %Q(#!/bin/env ruby
20
+ require_relative '../lib/harvester/pusher'
21
+ Pusher.activate("#{name}", "#{endpoint}")
22
+ )
23
+ end
24
+
25
+ def self.eye_config name
26
+ %Q(#!/bin/env ruby
27
+
28
+ Eye.application 'harvester' do
29
+
30
+ working_dir File.expand_path(File.join(File.dirname(__FILE__)))
31
+
32
+ group "#{name}" do
33
+ process :puller do
34
+ pid_file 'pids/puller.pid'
35
+ start_command "ruby puller.rb"
36
+ daemonize true
37
+ stdout 'logs/puller.log'
38
+ check :memory, every: 20.seconds, below: 300.megabytes, times: 3
39
+ end
40
+
41
+ process :parser do
42
+ pid_file 'pids/parser.pid'
43
+ start_command "ruby parser.rb"
44
+ daemonize true
45
+ stdout 'logs/parser.log'
46
+ check :memory, every: 20.seconds, below: 300.megabytes, times: 3
47
+ end
48
+
49
+ process :pusher do
50
+ pid_file 'pids/pusher.pid'
51
+ start_command "ruby pusher.rb"
52
+ daemonize true
53
+ stdout 'logs/pusher.log'
54
+ check :memory, every: 20.seconds, below: 300.megabytes, times: 3
55
+ end
56
+
57
+ end
58
+ end
59
+ )
60
+ end
61
+
62
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-harvester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kinnan Kwok
@@ -227,6 +227,8 @@ files:
227
227
  - lib/harvester/puller.rb
228
228
  - lib/harvester/pusher.rb
229
229
  - lib/harvester/settings.rb
230
+ - parser_functions/key_transactions.rb
231
+ - template/default_eye.rb
230
232
  homepage: http://github.com/kkwoker/api-harvester
231
233
  licenses:
232
234
  - MIT