marty 2.3.0 → 2.3.1

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
  SHA1:
3
- metadata.gz: 8dc054b69b36c3f88865983281fb580a69870469
4
- data.tar.gz: e09a7b2ec29e732f516d803fc9c3acec66db98c9
3
+ metadata.gz: 29ee1195170625cc6eb50d12a612fe502dc1b7b4
4
+ data.tar.gz: 7bbf0adc969bc474a90144deb4f5626b426e7ce2
5
5
  SHA512:
6
- metadata.gz: 647481fb469e7dc0a979c792eff8dcfab5367bd44e8df5f28cefde2e781c61e16730e8a29262c2cda1f36f04ee82ea18d87000014705df8126b3d4c26dd04512
7
- data.tar.gz: dd873fbce7126aa5ae3c947bc091edece040a8854be98be0991c03cdb32dedd4523c2978d8ea7c6c44d25c4f897bece30fe35b9cdcb79ffafb99cdcab1ecc1d0
6
+ metadata.gz: c387e23e8dee53fd1952560d8e51924876900b4eb5cdf7ce5bd910fa1980e574bb1b50f0df9a31ed7ea630fa4cdb01881cba2bc3ac646edd6cc036ae2dfe8210
7
+ data.tar.gz: 72759b95a84417cd0fb33e673548ca5fb83e064db20ce723aafa4a748f06acecb5241c12b37a13d22d7617d2c7fab16eb5a9300d1191c2900fb10b3e11aafac8
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- marty (2.3.0)
4
+ marty (2.3.1)
5
5
  aws-sigv4 (~> 1.0, >= 1.0.2)
6
6
  axlsx (= 3.0.0pre)
7
7
  coderay
@@ -4,7 +4,7 @@ class Marty::ImportView < Marty::Form
4
4
  action :apply do |a|
5
5
  a.text = I18n.t("data_import_view.import")
6
6
  a.tooltip = I18n.t("data_import_view.import")
7
- a.icon = :database_go
7
+ a.icon_cls = 'fa fa-database glyph'
8
8
  end
9
9
 
10
10
  def parent_model; end
@@ -7,11 +7,11 @@ module Marty::PgEnum
7
7
  raise "no such #{self.name}: '#{index}'" unless
8
8
  self::VALUES.include?(index)
9
9
 
10
- StringEnum.new(index)
10
+ index
11
11
  end
12
12
 
13
13
  def get_all(pt=nil)
14
- self::VALUES.map { |v| StringEnum.new(v) }
14
+ self::VALUES.map(&:to_s)
15
15
  end
16
16
 
17
17
  def self.extended(base)
@@ -154,37 +154,6 @@ module Netzke::Basepack::DataAdapters
154
154
  end
155
155
  end
156
156
 
157
- class StringEnum < String
158
- include Delorean::Model
159
- def name
160
- self.to_s
161
- end
162
- def id
163
- self
164
- end
165
- delorean_instance_method :name
166
- delorean_instance_method :id
167
-
168
- def to_yaml(opts = {})
169
- YAML::quick_emit(nil, opts) do |out|
170
- out.scalar('stringEnum', self.to_s, :plain)
171
- end
172
- end
173
-
174
- def _dump _
175
- self.to_s
176
- end
177
-
178
- def self._load(v)
179
- new(v)
180
- end
181
- end
182
-
183
- YAML::add_domain_type("pennymac.com,2017-06-02", "stringEnum") do
184
- |type, val|
185
- StringEnum.new(val)
186
- end
187
-
188
157
  ######################################################################
189
158
 
190
159
  # Add pg_enum migration support -- FIXME: this doesn't belong here
@@ -201,15 +170,6 @@ module ActiveRecord
201
170
  column(name, enum || name.to_s.pluralize, options) }
202
171
  end
203
172
  end
204
- module PostgreSQL
205
- module OID
206
- class Enum < Type::Value
207
- def cast(value)
208
- value && StringEnum.new(value)
209
- end
210
- end
211
- end
212
- end
213
173
  end
214
174
  end
215
175
 
@@ -103,15 +103,13 @@ class Marty::RuleScriptSet < Delorean::AbstractContainer
103
103
  result_c = result_code(ruleh)
104
104
  guard_c = guard_code(ruleh)
105
105
 
106
- code = self.class.body_start + self.class.indent(grid_i +
107
- guard_c +
108
- grid_c +
109
- result_c)
110
- #puts '='*40
111
- #puts ruleh["name"]
112
- #puts '-'
113
- #puts code
114
- #puts '-'*10
106
+ code = self.class.body_start +
107
+ self.class.indent(grid_i + guard_c + grid_c + result_c)
108
+ # puts '='*40
109
+ # puts ruleh["name"]
110
+ # puts '-'
111
+ # puts code
112
+ # puts '-'*10
115
113
 
116
114
  code
117
115
  end
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "2.3.0"
2
+ VERSION = "2.3.1"
3
3
  end
@@ -18,7 +18,9 @@ module Marty::Diagnostic; class Base < Request
18
18
  end
19
19
  class << self
20
20
  define_method :generate do
21
- pack{yield}
21
+ pack do
22
+ yield
23
+ end
22
24
  end
23
25
  end
24
26
  end
@@ -25,4 +25,21 @@ module Marty::Diagnostic::Database
25
25
  ActiveRecord::Migrator.needs_migration?
26
26
  current.to_s
27
27
  end
28
+
29
+ def self.get_postgres_connections
30
+ conn = ActiveRecord::Base.connection.execute('SELECT datname,'\
31
+ 'application_name,'\
32
+ 'state,'\
33
+ 'pid,'\
34
+ 'client_addr '\
35
+ 'FROM pg_stat_activity')
36
+ conn.each_with_object({}) do |conn, h|
37
+ h[conn['datname']] ||= []
38
+ h[conn['datname']] << conn.except('datname')
39
+ end
40
+ end
41
+
42
+ def self.current_connections
43
+ get_postgres_connections[db_name]
44
+ end
28
45
  end
@@ -0,0 +1,10 @@
1
+ module Marty::Diagnostic; class DelayedJobWorkerTotalCount < Base
2
+ diagnostic_fn(aggregatable: false) do
3
+ count = Database.current_connections.map do |c|
4
+ [c['application_name'], c['client_addr'] || '127.0.0.1'] if
5
+ c['application_name'].include?('delayed')
6
+ end.compact.uniq.count
7
+ {'Delayed Workers' => count.zero? ? error(count) : count}
8
+ end
9
+ end
10
+ end
@@ -1,14 +1,12 @@
1
1
  module Marty::Diagnostic; class DelayedJobWorkers < Base
2
2
  diagnostic_fn do
3
3
  my_ip = Node.my_ip
4
- conns = Node.get_postgres_connections[Database.db_name]
5
- workers = conns.map do |c|
4
+ workers = Database.current_connections.map do |c|
6
5
  ip = c['client_addr'] || '127.0.0.1'
7
6
  name = c['application_name']
8
7
  name if name.include?('delayed') && (ip == my_ip || ip == '127.0.0.1')
9
8
  end.compact.uniq.count
10
-
11
- workers.zero? ? error(workers) : workers
9
+ {'Delayed Workers / Node' => workers.zero? ? error(workers) : workers}
12
10
  end
13
11
  end
14
12
  end
@@ -7,21 +7,10 @@ module Marty::Diagnostic::Node
7
7
  end
8
8
  end
9
9
 
10
- def self.get_postgres_connections
11
- conn = ActiveRecord::Base.connection.execute('SELECT datname,'\
12
- 'application_name,'\
13
- 'state,'\
14
- 'pid,'\
15
- 'client_addr '\
16
- 'FROM pg_stat_activity')
17
- conn.each_with_object({}) do |conn, h|
18
- h[conn['datname']] ||= []
19
- h[conn['datname']] << conn.except('datname')
20
- end
21
- end
10
+
22
11
 
23
12
  def self.get_target_connections target
24
- get_postgres_connections[Marty::Diagnostic::Database.db_name].select{|conn|
13
+ Marty::Diagnostic::Database.current_connections.select{|conn|
25
14
  conn['application_name'].include?(target)
26
15
  }.map{|conn|
27
16
  conn['client_addr'] == '127.0.0.1' ? my_ip :
@@ -1,9 +1,9 @@
1
1
  module Marty::Diagnostic; class Reporter < Request
2
2
  class_attribute :reports, :diagnostics, :namespaces
3
3
 
4
- self.reports = {}
4
+ self.reports = {}
5
5
  self.diagnostics = []
6
- self.namespaces = ['Marty']
6
+ self.namespaces = ['Marty']
7
7
 
8
8
  def self.run request
9
9
  self.request = request
@@ -27,6 +27,9 @@ describe 'Jobs Dashboard', type: :feature, js: true, capybara: true do
27
27
  find(ext_menuitem_id('Jobs Dashboard')).click
28
28
  page_title = I18n.t("jobs.promise_view")
29
29
  expect(page).to have_content(page_title)
30
+
31
+ sleep 1
32
+
30
33
  expect(tree_row_count(page_title)).to eq(2)
31
34
 
32
35
  fill_in "live_search_text", with: 'marty'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marty
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Bostani
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2018-08-15 00:00:00.000000000 Z
17
+ date: 2018-08-16 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: pg
@@ -525,6 +525,7 @@ files:
525
525
  - other/marty/diagnostic/connections.rb
526
526
  - other/marty/diagnostic/database.rb
527
527
  - other/marty/diagnostic/delayed_job_version.rb
528
+ - other/marty/diagnostic/delayed_job_worker_total_count.rb
528
529
  - other/marty/diagnostic/delayed_job_workers.rb
529
530
  - other/marty/diagnostic/environment_variables.rb
530
531
  - other/marty/diagnostic/fatal.rb