funktor 0.2.12 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2addf59e5fe60847983267586ba7b516aba00adcd9b18da4eb96642f1190494
4
- data.tar.gz: fedce04333fe565c37ffc98091c9ddb6f1968c32068db5fbd0e4d4a1677635d0
3
+ metadata.gz: c7b7b575e4abcc04a0b771e3fb9afb912ee82015ed7aa6bcb17570fca0f392fa
4
+ data.tar.gz: 98d8caf556c78960b73a1ee40831d4165b01836831d65eb17014239450a5dce7
5
5
  SHA512:
6
- metadata.gz: 4fb6489eec9d5035cda3b4d60c9c6e6045716b962d4cc0de9c73f1dbd79d0789e9a7c4707bed18f0fe69e02494db434f688840cd07a0a8fc80bae99e1a2faf91
7
- data.tar.gz: ae9e4add3a06ae1d4c10e915a8cad32192476185b47adcd17fcdf55b612e1cf3b86659245b2f55c23a43f0f18d3c8cc5b7f18daf26fca40299f7cc52cc66354e
6
+ metadata.gz: 46b2e852ec64c6f4f5ea23422ec987e95941583f51fe8d76a254df36093c543a4b250c4de5f35abd32df1f9fd8db96df6655b397248697c134a208b8bc60d6f9
7
+ data.tar.gz: a7231805102b4a7b05ce8eade0c35c4798779e6ca88171a294137bc20a334e32da47927abdb607d00f83d3585d7dec0d5706c2f6a6baab2e5cbf769b768e4532
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- funktor (0.2.12)
4
+ funktor (0.2.17)
5
5
  activesupport
6
6
  aws-sdk-sqs (~> 1.37)
7
7
  thor
@@ -18,13 +18,13 @@ GEM
18
18
  addressable (2.7.0)
19
19
  public_suffix (>= 2.0.2, < 5.0)
20
20
  aws-eventstream (1.1.1)
21
- aws-partitions (1.472.0)
21
+ aws-partitions (1.473.0)
22
22
  aws-sdk-core (3.115.0)
23
23
  aws-eventstream (~> 1, >= 1.0.2)
24
24
  aws-partitions (~> 1, >= 1.239.0)
25
25
  aws-sigv4 (~> 1.1)
26
26
  jmespath (~> 1.0)
27
- aws-sdk-sqs (1.39.0)
27
+ aws-sdk-sqs (1.40.0)
28
28
  aws-sdk-core (~> 3, >= 3.112.0)
29
29
  aws-sigv4 (~> 1.1)
30
30
  aws-sigv4 (1.2.3)
@@ -7,10 +7,126 @@ Resources:
7
7
  {
8
8
  "widgets": [
9
9
 
10
+ <% current_y = 0 %>
11
+
12
+ { <% "Funktor Banner" %>
13
+ "height": 3,
14
+ "width": 24,
15
+ "y": <%= current_y %>,
16
+ "x": 0,
17
+ "type": "text",
18
+ "properties": {
19
+ "markdown": "\n# Funktor Auto-generated Dashbaord\n\n This dashboard is auto-generated by Funktor and will be updated as Funktor progresses. If you want to customize this dashboard you should use 'Actions => Save dashbaord as' in the toolbar above to create a new dashboard of your own.\n\n The upper section shows you high level queue and worker stats, the lower sections show more details about all the AWS resources at play."
20
+ }
21
+ },
22
+ <% current_y += 3 %>
23
+
24
+ { <% "Job Duration By Worker" %>
25
+ "height": 6,
26
+ "width": 12,
27
+ "y": <%= current_y %>,
28
+ "x": 12,
29
+ "type": "metric",
30
+ "properties": {
31
+ "metrics": [
32
+ <%- app_worker_names.each do |worker_name| -%>
33
+ [ "<%= app_name %>", "Duration", "WorkerClassName", "<%= worker_name %>" ],
34
+ [ "...", { "stat": "p99" } ]<%= worker_name == app_worker_names.last ? "" : "," %>
35
+ <%- end -%>
36
+ ],
37
+ "view": "timeSeries",
38
+ "stacked": false,
39
+ "region": "us-east-1",
40
+ "stat": "Average",
41
+ "period": 60,
42
+ "title": "Job Duration by Worker"
43
+ }
44
+ },
45
+
46
+ { <% "Processed/Failed Jobs By Worker" %>
47
+ "height": 6,
48
+ "width": 12,
49
+ "y": <%= current_y %>,
50
+ "x": 0,
51
+ "type": "metric",
52
+ "properties": {
53
+ "metrics": [
54
+ <%- app_worker_names.each do |worker_name| -%>
55
+ [ "<%= app_name %>", "processed", "WorkerClassName", "<%= worker_name %>" ],
56
+ [ ".", "failed", ".", "." ]<%= worker_name == app_worker_names.last ? "" : "," %>
57
+ <%- end -%>
58
+ ],
59
+ "view": "timeSeries",
60
+ "stacked": false,
61
+ "region": "us-east-1",
62
+ "title": "Process/Failed Jobs By Worker",
63
+ "period": 60,
64
+ "stat": "Sum"
65
+ }
66
+ },
67
+ <% current_y += 6 %>
68
+ { <% "Job Duration By Queue" %>
69
+ "height": 6,
70
+ "width": 12,
71
+ "y": <%= current_y %>,
72
+ "x": 12,
73
+ "type": "metric",
74
+ "properties": {
75
+ "metrics": [
76
+ <%- queue_names.each do |queue_name| -%>
77
+ [ "<%= app_name %>", "Duration", "Queue", "<%= queue_name %>" ],
78
+ [ "...", { "stat": "p99" } ]<%= queue_name == queue_names.last ? "" : "," %>
79
+ <%- end -%>
80
+ ],
81
+ "view": "timeSeries",
82
+ "stacked": false,
83
+ "region": "us-east-1",
84
+ "stat": "Average",
85
+ "period": 60,
86
+ "title": "Job Duration by Queue"
87
+ }
88
+ },
89
+ { <% "Processed/Failed Jobs By Queue" %>
90
+ "height": 6,
91
+ "width": 12,
92
+ "y": <%= current_y %>,
93
+ "x": 0,
94
+ "type": "metric",
95
+ "properties": {
96
+ "metrics": [
97
+ <%- queue_names.each do |queue_name| -%>
98
+ [ "<%= app_name %>", "processed", "Queue", "<%= queue_name %>" ],
99
+ [ ".", "failed", ".", "." ]<%= queue_name == queue_names.last ? "" : "," %>
100
+ <%- end -%>
101
+ ],
102
+ "view": "timeSeries",
103
+ "stacked": false,
104
+ "region": "us-east-1",
105
+ "title": "Process/Failed Jobs By Queue",
106
+ "period": 60,
107
+ "stat": "Sum"
108
+ }
109
+ },
110
+
111
+
112
+ { <% "Funktor Behind the Scenes Banner" %>
113
+ "height": 3,
114
+ "width": 24,
115
+ "y": <%= current_y %>,
116
+ "x": 0,
117
+ "type": "text",
118
+ "properties": {
119
+ "markdown": "\n# Behind the scenes\n\n The stats below give some insight into the inner workings of the Funktor apparatus."
120
+ }
121
+ },
122
+ <% current_y += 3 %>
123
+
124
+
125
+ <% current_y += 6 %>
10
126
  { <% "Incoming Jobs" %>
11
127
  "height": 3,
12
128
  "width": 6,
13
- "y": 0,
129
+ "y": <%= current_y %>,
14
130
  "x": 0,
15
131
  "type": "text",
16
132
  "properties": {
@@ -20,7 +136,7 @@ Resources:
20
136
  { <% "Incoming Job Queue Messages per minute" %>
21
137
  "height": 3,
22
138
  "width": 3,
23
- "y": 0,
139
+ "y": <%= current_y %>,
24
140
  "x": 6,
25
141
  "type": "metric",
26
142
  "properties": {
@@ -37,7 +153,7 @@ Resources:
37
153
  { <% "Incoming Job Handler Duration" %>
38
154
  "height": 3,
39
155
  "width": 15,
40
- "y": 0,
156
+ "y": <%= current_y %>,
41
157
  "x": 9,
42
158
  "type": "metric",
43
159
  "properties": {
@@ -55,10 +171,12 @@ Resources:
55
171
  }
56
172
  },
57
173
 
174
+
175
+ <% current_y += 3 %>
58
176
  { <% "Incoming Job Queue (Async & scheduled jobs land here first)" %>
59
177
  "height": 6,
60
178
  "width": 9,
61
- "y": 3,
179
+ "y": <%= current_y %>,
62
180
  "x": 0,
63
181
  "type": "metric",
64
182
  "properties": {
@@ -84,7 +202,7 @@ Resources:
84
202
  { <% "Incoming Job Handler Duration in Milliseconds" %>
85
203
  "height": 6,
86
204
  "width": 9,
87
- "y": 3,
205
+ "y": <%= current_y %>,
88
206
  "x": 9,
89
207
  "type": "metric",
90
208
  "properties": {
@@ -104,7 +222,7 @@ Resources:
104
222
  { <% "Incoming Job Handler Error count and success rate (%)" %>
105
223
  "height": 3,
106
224
  "width": 6,
107
- "y": 3,
225
+ "y": <%= current_y %>,
108
226
  "x": 18,
109
227
  "type": "metric",
110
228
  "properties": {
@@ -131,7 +249,7 @@ Resources:
131
249
  { <% "Incoming Job Handler Concurrent Executions" %>
132
250
  "height": 3,
133
251
  "width": 6,
134
- "y": 6,
252
+ "y": <%= current_y + 3 %>,
135
253
  "x": 18,
136
254
  "type": "metric",
137
255
  "properties": {
@@ -149,7 +267,7 @@ Resources:
149
267
 
150
268
 
151
269
 
152
- <% current_y = 9 %>
270
+ <% current_y += 6 %>
153
271
  <%- queue_names.each do |queue_name| -%>
154
272
  { <% "Active Jobs" %>
155
273
  "height": 3,
@@ -300,28 +418,7 @@ Resources:
300
418
  <% current_y += 9 %>
301
419
  <%- end -%>
302
420
 
303
- { <% "Job Duration By Worker" %>
304
- "height": 6,
305
- "width": 24,
306
- "y": <%= current_y %>,
307
- "x": 0,
308
- "type": "metric",
309
- "properties": {
310
- "metrics": [
311
- <%- app_worker_names.each do |worker_name| -%>
312
- [ "<%= app_name %>", "Duration", "WorkerClassName", "<%= worker_name %>" ],
313
- [ "...", { "stat": "p99" } ]<%= worker_name == app_worker_names.last ? "" : "," %>
314
- <%- end -%>
315
- ],
316
- "view": "timeSeries",
317
- "stacked": false,
318
- "region": "us-east-1",
319
- "stat": "Average",
320
- "period": 60,
321
- "title": "Job Duration by Worker"
322
- }
323
- },
324
- <% current_y += 6 %>
421
+
325
422
 
326
423
  { <% "Delayed Jobs" %>
327
424
  "height": 3,
@@ -551,5 +648,8 @@ Resources:
551
648
  }
552
649
  }
553
650
 
651
+
652
+
653
+
554
654
  ]
555
655
  }
@@ -21,7 +21,7 @@ module Funktor
21
21
  "CloudWatchMetrics": [
22
22
  {
23
23
  "Namespace": ENV['FUNKTOR_APP_NAME'],
24
- "Dimensions": [["WorkerClassName"]],
24
+ "Dimensions": [["WorkerClassName"], ["Queue"]],
25
25
  "Metrics": [ # CPU, Memory, Duration, etc...
26
26
  {
27
27
  "Name": dimension,
@@ -32,6 +32,7 @@ module Funktor
32
32
  ]
33
33
  },
34
34
  "WorkerClassName": job.worker_class_name,
35
+ "Queue": job.queue,
35
36
  "#{dimension}": 1
36
37
  #"count": value,
37
38
  #"requestId": "989ffbf8-9ace-4817-a57c-e4dd734019ee"
data/lib/funktor/job.rb CHANGED
@@ -35,7 +35,11 @@ module Funktor
35
35
  end
36
36
 
37
37
  def delay
38
- job_data["delay"]
38
+ # TODO - In Funktor Pro we need to override this method (or do something else) so that
39
+ # we can schedule jobs farther in the future than 15 minutes. We do this here in case a
40
+ # retry sequence goes too long.
41
+ jdelay = job_data["delay"]
42
+ return jdelay < 900 ? jdelay : 900
39
43
  end
40
44
 
41
45
  def delay=(delay)
@@ -20,7 +20,7 @@ module Funktor
20
20
  "CloudWatchMetrics": [
21
21
  {
22
22
  "Namespace": ENV['FUNKTOR_APP_NAME'],
23
- "Dimensions": [["WorkerClassName"]],
23
+ "Dimensions": [["WorkerClassName"], ["Queue"]],
24
24
  "Metrics": [ # CPU, Memory, Duration, etc...
25
25
  {
26
26
  "Name": "Duration",
@@ -31,6 +31,7 @@ module Funktor
31
31
  ]
32
32
  },
33
33
  "WorkerClassName": job.worker_class_name,
34
+ "Queue": job.queue,
34
35
  "Duration": time_diff_in_seconds * 1_000
35
36
  #"count": value,
36
37
  #"requestId": "989ffbf8-9ace-4817-a57c-e4dd734019ee"
@@ -1,3 +1,3 @@
1
1
  module Funktor
2
- VERSION = "0.2.12"
2
+ VERSION = "0.2.17"
3
3
  end
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.2.12
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-30 00:00:00.000000000 Z
11
+ date: 2021-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sqs