funktor 0.7.29 → 0.7.30

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
  SHA256:
3
- metadata.gz: dc2b8fd9bad2bcfa73c2eb5f7db5da733cb3abaa9fa9fb1d3903d895b8c43c8e
4
- data.tar.gz: 782afbe2de67f9fbe35e1a68fae7bf9fa80edd342af1c08cde4ce87535c152a1
3
+ metadata.gz: 8d203ecf9e2339ebe66302ae0224fb17a6529f0cf3e22eb71b95b7025527f9b1
4
+ data.tar.gz: 28b8a6774c12241aa583c3268b925aed85f72692eea0f96655567e7fc539a2b9
5
5
  SHA512:
6
- metadata.gz: c985f55a5fe9fd70a7572ae40f45536180f3ab08740a529c5df2cbf0627d5aae12e7a190ee6bfcc5aadedee2b1667d9b986aa85f915e22eda421a314d853159a
7
- data.tar.gz: e2d62a4d78348a957e7cb296526fd4010632a96a47aa8874fe84f14093d73dd450c80c9ef3b04519d4f75f7c4db0c435dd26008c3bff7fa9cb26976e16273bfe
6
+ metadata.gz: 2309beb1a659c3bd5fcfa7b4f3092de4381e84d26195fbd8fc52f0c32b47bf490bb91ec2dadacd026624c31fc80906e303e40c13e55bc74942f0ffdd504c9d9d
7
+ data.tar.gz: d9a3386b7d8e6cf320450ed7ff5d3b4a4c21de88bd1976bbf7f28bcabb67964236bbe770a3b2c5e11543cfa63e2743ccc14da4f0d79b8efe1edccc714919e840
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- funktor (0.7.29)
4
+ funktor (0.7.30)
5
5
  activesupport
6
6
  aws-sdk-dynamodb (~> 1.62)
7
7
  aws-sdk-sqs (~> 1.37)
@@ -22,13 +22,13 @@ GEM
22
22
  addressable (2.8.0)
23
23
  public_suffix (>= 2.0.2, < 5.0)
24
24
  aws-eventstream (1.2.0)
25
- aws-partitions (1.597.0)
26
- aws-sdk-core (3.131.1)
25
+ aws-partitions (1.604.0)
26
+ aws-sdk-core (3.131.2)
27
27
  aws-eventstream (~> 1, >= 1.0.2)
28
28
  aws-partitions (~> 1, >= 1.525.0)
29
29
  aws-sigv4 (~> 1.1)
30
30
  jmespath (~> 1, >= 1.6.1)
31
- aws-sdk-dynamodb (1.74.0)
31
+ aws-sdk-dynamodb (1.75.0)
32
32
  aws-sdk-core (~> 3, >= 3.127.0)
33
33
  aws-sigv4 (~> 1.1)
34
34
  aws-sdk-sqs (1.51.1)
@@ -6,7 +6,7 @@ require "rubygems"
6
6
  require 'bundler/setup'
7
7
 
8
8
  # load bootsnap for faster cold starts
9
- require 'bootsnap/setup'
9
+ #require 'bootsnap/setup'
10
10
 
11
11
  # Set up gems listed in the Gemfile.
12
12
  Bundler.require(:default, :production)
@@ -17,6 +17,7 @@ require 'funktor'
17
17
 
18
18
 
19
19
  Funktor.enable_work_queue_visibility = false
20
+ Funktor.enable_activity_tracking = false
20
21
 
21
22
  # Load all ruby files in the app directory
22
23
  require_rel File.join('..', 'app')
@@ -40,6 +40,10 @@ module Funktor
40
40
  }
41
41
 
42
42
  def track(activity, job)
43
+ unless Funktor.enable_activity_tracking
44
+ Funktor.logger.debug "activity tracking is disabled"
45
+ return
46
+ end
43
47
  Funktor.logger.debug "starting track activity for #{activity}"
44
48
  incrKey = nil || INCR_KEYS[activity.to_sym]
45
49
  decrKey = nil || DECR_KEYS[activity.to_sym]
@@ -1,4 +1,9 @@
1
1
  require 'new_relic/agent'
2
+ # This is kind of a brute force approach that's not very performant. It's based on this documentaion:
3
+ # https://docs.newrelic.com/docs/apm/agents/ruby-agent/background-jobs/monitor-ruby-background-processes
4
+ #
5
+ # It might be better if we could use the NewRelic Lambda Layer, but currently it doesn't seem to support Ruby.
6
+ # https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/monitoring-aws-lambda-serverless-monitoring
2
7
  module Funktor
3
8
  module Middleware
4
9
  class NewRelic
@@ -1,3 +1,3 @@
1
1
  module Funktor
2
- VERSION = "0.7.29"
2
+ VERSION = "0.7.30"
3
3
  end
data/lib/funktor.rb CHANGED
@@ -21,7 +21,8 @@ module Funktor
21
21
  DEFAULT_OPTIONS = {
22
22
  error_handlers: [],
23
23
  log_level: Logger::DEBUG, # Set a high log level during early, active development
24
- enable_work_queue_visibility: true # Enable this by default during early, active development
24
+ enable_work_queue_visibility: true, # Enable this by default during early, active development
25
+ enable_activity_tracking: true, # Enable this by default during early, active development
25
26
  }
26
27
 
27
28
  def self.configure_job_pusher
@@ -121,6 +122,14 @@ module Funktor
121
122
  options[:enable_work_queue_visibility] = enabled
122
123
  end
123
124
 
125
+ def self.enable_activity_tracking
126
+ options[:enable_activity_tracking]
127
+ end
128
+
129
+ def self.enable_activity_tracking= enabled
130
+ options[:enable_activity_tracking] = enabled
131
+ end
132
+
124
133
  # We have a raw_logger that doesn't add timestamps and what not. This is used to publish
125
134
  # CloudWatch metrics that can be used in dashboards.
126
135
  def self.raw_logger
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funktor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.29
4
+ version: 0.7.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-07 00:00:00.000000000 Z
11
+ date: 2022-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sqs