grumlin 0.19.2 → 0.19.5
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 +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile +9 -5
- data/Gemfile.lock +56 -53
- data/Rakefile +2 -0
- data/bin/console +1 -1
- data/grumlin.gemspec +2 -2
- data/lib/grumlin/benchmark/repository.rb +21 -0
- data/lib/grumlin/request_dispatcher.rb +4 -4
- data/lib/grumlin/test/rspec/db_cleaner_context.rb +2 -1
- data/lib/grumlin/typing.rb +1 -1
- data/lib/grumlin/version.rb +1 -1
- data/lib/grumlin.rb +3 -3
- data/lib/tasks/benchmark.rake +17 -0
- metadata +8 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80bbea20c7a9e194618b59cc128ae8e783af4d342ddd9ca56039f08013218a81
|
|
4
|
+
data.tar.gz: baf7565f084501e8b4488bf5d7d8e09a5c786b91181dda46919b0668662ecfd0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c2760d46e3bada592f71da13bbbec31a970cde6c112a57d06f435eb673ba213573d98e82e65080c5453f521c27c27f6037472cd1db65046dfa31432f879d3e1
|
|
7
|
+
data.tar.gz: e6a073136f3ebeaaf1cac78a6c6886a2e7a91beeaf18a61d340e18ab968018859861de64fc01a04f7ba708fea9ab8859706b6edb5f27c9432a2116717d323c55
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
|
@@ -5,19 +5,23 @@ source "https://rubygems.org"
|
|
|
5
5
|
gemspec
|
|
6
6
|
|
|
7
7
|
gem "nokogiri"
|
|
8
|
-
gem "
|
|
9
|
-
gem "rubocop-performance"
|
|
10
|
-
gem "rubocop-rspec"
|
|
8
|
+
gem "parallel"
|
|
11
9
|
|
|
12
10
|
gem "solargraph"
|
|
13
11
|
|
|
14
|
-
gem "async-rspec"
|
|
15
|
-
gem "factory_bot"
|
|
16
12
|
gem "overcommit"
|
|
17
13
|
gem "rake"
|
|
14
|
+
|
|
15
|
+
gem "async-rspec"
|
|
16
|
+
gem "factory_bot"
|
|
18
17
|
gem "rspec"
|
|
18
|
+
|
|
19
19
|
gem "simplecov"
|
|
20
20
|
|
|
21
21
|
gem "benchmark-ips"
|
|
22
22
|
gem "memory_profiler"
|
|
23
23
|
gem "ruby-prof"
|
|
24
|
+
|
|
25
|
+
gem "rubocop"
|
|
26
|
+
gem "rubocop-performance"
|
|
27
|
+
gem "rubocop-rspec"
|
data/Gemfile.lock
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
grumlin (0.19.
|
|
4
|
+
grumlin (0.19.5)
|
|
5
5
|
async-pool (~> 0.3)
|
|
6
6
|
async-websocket (~> 0.19)
|
|
7
|
-
oj (~> 3.
|
|
7
|
+
oj (~> 3.13)
|
|
8
8
|
retryable (~> 3.0)
|
|
9
|
-
zeitwerk (~> 2.
|
|
9
|
+
zeitwerk (~> 2.6)
|
|
10
10
|
|
|
11
11
|
GEM
|
|
12
12
|
remote: https://rubygems.org/
|
|
13
13
|
specs:
|
|
14
|
-
activesupport (
|
|
14
|
+
activesupport (7.0.3)
|
|
15
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
16
16
|
i18n (>= 1.6, < 2)
|
|
17
17
|
minitest (>= 5.1)
|
|
18
18
|
tzinfo (~> 2.0)
|
|
19
|
-
zeitwerk (~> 2.3)
|
|
20
19
|
ast (2.4.2)
|
|
21
20
|
async (1.30.2)
|
|
22
21
|
console (~> 1.10)
|
|
@@ -34,7 +33,7 @@ GEM
|
|
|
34
33
|
async
|
|
35
34
|
async-pool (0.3.10)
|
|
36
35
|
async (>= 1.25)
|
|
37
|
-
async-rspec (1.16.
|
|
36
|
+
async-rspec (1.16.1)
|
|
38
37
|
rspec (~> 3.0)
|
|
39
38
|
rspec-files (~> 1.0)
|
|
40
39
|
rspec-memory (~> 1.0)
|
|
@@ -43,41 +42,42 @@ GEM
|
|
|
43
42
|
async-io (~> 1.23)
|
|
44
43
|
protocol-websocket (~> 0.7.0)
|
|
45
44
|
backport (1.2.0)
|
|
46
|
-
benchmark (0.
|
|
45
|
+
benchmark (0.2.0)
|
|
47
46
|
benchmark-ips (2.10.0)
|
|
48
|
-
childprocess (4.
|
|
49
|
-
concurrent-ruby (1.1.
|
|
50
|
-
console (1.15.
|
|
47
|
+
childprocess (4.1.0)
|
|
48
|
+
concurrent-ruby (1.1.10)
|
|
49
|
+
console (1.15.3)
|
|
51
50
|
fiber-local
|
|
52
|
-
diff-lcs (1.
|
|
51
|
+
diff-lcs (1.5.0)
|
|
53
52
|
docile (1.4.0)
|
|
54
53
|
e2mmap (0.1.0)
|
|
55
|
-
factory_bot (6.2.
|
|
54
|
+
factory_bot (6.2.1)
|
|
56
55
|
activesupport (>= 5.0.0)
|
|
57
56
|
fiber-local (1.0.0)
|
|
58
|
-
i18n (1.
|
|
57
|
+
i18n (1.10.0)
|
|
59
58
|
concurrent-ruby (~> 1.0)
|
|
60
59
|
iniparse (1.5.0)
|
|
61
60
|
jaro_winkler (1.5.4)
|
|
62
|
-
kramdown (2.
|
|
61
|
+
kramdown (2.4.0)
|
|
63
62
|
rexml
|
|
64
63
|
kramdown-parser-gfm (1.1.0)
|
|
65
64
|
kramdown (~> 2.0)
|
|
66
65
|
memory_profiler (1.0.0)
|
|
67
|
-
mini_portile2 (2.
|
|
68
|
-
minitest (5.
|
|
66
|
+
mini_portile2 (2.8.0)
|
|
67
|
+
minitest (5.15.0)
|
|
69
68
|
nio4r (2.5.8)
|
|
70
|
-
nokogiri (1.13.
|
|
71
|
-
mini_portile2 (~> 2.
|
|
69
|
+
nokogiri (1.13.6)
|
|
70
|
+
mini_portile2 (~> 2.8.0)
|
|
72
71
|
racc (~> 1.4)
|
|
73
|
-
nokogiri (1.13.
|
|
72
|
+
nokogiri (1.13.6-x86_64-linux)
|
|
74
73
|
racc (~> 1.4)
|
|
75
|
-
oj (3.13.
|
|
76
|
-
overcommit (0.
|
|
74
|
+
oj (3.13.14)
|
|
75
|
+
overcommit (0.59.1)
|
|
77
76
|
childprocess (>= 0.6.3, < 5)
|
|
78
77
|
iniparse (~> 1.4)
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
rexml (~> 3.2)
|
|
79
|
+
parallel (1.22.1)
|
|
80
|
+
parser (3.1.2.0)
|
|
81
81
|
ast (~> 2.4.1)
|
|
82
82
|
protocol-hpack (1.4.2)
|
|
83
83
|
protocol-http (0.22.6)
|
|
@@ -90,45 +90,45 @@ GEM
|
|
|
90
90
|
protocol-http (~> 0.2)
|
|
91
91
|
protocol-http1 (~> 0.2)
|
|
92
92
|
racc (1.6.0)
|
|
93
|
-
rainbow (3.
|
|
94
|
-
rake (13.0.
|
|
95
|
-
regexp_parser (2.
|
|
93
|
+
rainbow (3.1.1)
|
|
94
|
+
rake (13.0.6)
|
|
95
|
+
regexp_parser (2.5.0)
|
|
96
96
|
retryable (3.0.5)
|
|
97
|
-
reverse_markdown (2.
|
|
97
|
+
reverse_markdown (2.1.1)
|
|
98
98
|
nokogiri
|
|
99
99
|
rexml (3.2.5)
|
|
100
|
-
rspec (3.
|
|
101
|
-
rspec-core (~> 3.
|
|
102
|
-
rspec-expectations (~> 3.
|
|
103
|
-
rspec-mocks (~> 3.
|
|
104
|
-
rspec-core (3.
|
|
105
|
-
rspec-support (~> 3.
|
|
106
|
-
rspec-expectations (3.
|
|
100
|
+
rspec (3.11.0)
|
|
101
|
+
rspec-core (~> 3.11.0)
|
|
102
|
+
rspec-expectations (~> 3.11.0)
|
|
103
|
+
rspec-mocks (~> 3.11.0)
|
|
104
|
+
rspec-core (3.11.0)
|
|
105
|
+
rspec-support (~> 3.11.0)
|
|
106
|
+
rspec-expectations (3.11.0)
|
|
107
107
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
108
|
-
rspec-support (~> 3.
|
|
109
|
-
rspec-files (1.1.
|
|
108
|
+
rspec-support (~> 3.11.0)
|
|
109
|
+
rspec-files (1.1.2)
|
|
110
110
|
rspec (~> 3.0)
|
|
111
|
-
rspec-memory (1.0.
|
|
111
|
+
rspec-memory (1.0.3)
|
|
112
112
|
rspec (~> 3.0)
|
|
113
|
-
rspec-mocks (3.
|
|
113
|
+
rspec-mocks (3.11.1)
|
|
114
114
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
115
|
-
rspec-support (~> 3.
|
|
116
|
-
rspec-support (3.
|
|
117
|
-
rubocop (1.
|
|
115
|
+
rspec-support (~> 3.11.0)
|
|
116
|
+
rspec-support (3.11.0)
|
|
117
|
+
rubocop (1.30.1)
|
|
118
118
|
parallel (~> 1.10)
|
|
119
|
-
parser (>= 3.
|
|
119
|
+
parser (>= 3.1.0.0)
|
|
120
120
|
rainbow (>= 2.2.2, < 4.0)
|
|
121
121
|
regexp_parser (>= 1.8, < 3.0)
|
|
122
|
-
rexml
|
|
123
|
-
rubocop-ast (>= 1.
|
|
122
|
+
rexml (>= 3.2.5, < 4.0)
|
|
123
|
+
rubocop-ast (>= 1.18.0, < 2.0)
|
|
124
124
|
ruby-progressbar (~> 1.7)
|
|
125
125
|
unicode-display_width (>= 1.4.0, < 3.0)
|
|
126
|
-
rubocop-ast (1.
|
|
127
|
-
parser (>= 3.
|
|
128
|
-
rubocop-performance (1.
|
|
126
|
+
rubocop-ast (1.18.0)
|
|
127
|
+
parser (>= 3.1.1.0)
|
|
128
|
+
rubocop-performance (1.14.2)
|
|
129
129
|
rubocop (>= 1.7.0, < 2.0)
|
|
130
130
|
rubocop-ast (>= 0.4.0)
|
|
131
|
-
rubocop-rspec (2.
|
|
131
|
+
rubocop-rspec (2.11.1)
|
|
132
132
|
rubocop (~> 1.19)
|
|
133
133
|
ruby-prof (1.4.3)
|
|
134
134
|
ruby-progressbar (1.11.0)
|
|
@@ -137,8 +137,8 @@ GEM
|
|
|
137
137
|
simplecov-html (~> 0.11)
|
|
138
138
|
simplecov_json_formatter (~> 0.1)
|
|
139
139
|
simplecov-html (0.12.3)
|
|
140
|
-
simplecov_json_formatter (0.1.
|
|
141
|
-
solargraph (0.
|
|
140
|
+
simplecov_json_formatter (0.1.4)
|
|
141
|
+
solargraph (0.45.0)
|
|
142
142
|
backport (~> 1.2)
|
|
143
143
|
benchmark
|
|
144
144
|
bundler (>= 1.17.2)
|
|
@@ -153,15 +153,17 @@ GEM
|
|
|
153
153
|
thor (~> 1.0)
|
|
154
154
|
tilt (~> 2.0)
|
|
155
155
|
yard (~> 0.9, >= 0.9.24)
|
|
156
|
-
thor (1.1
|
|
156
|
+
thor (1.2.1)
|
|
157
157
|
tilt (2.0.10)
|
|
158
158
|
timers (4.3.3)
|
|
159
159
|
traces (0.4.1)
|
|
160
160
|
tzinfo (2.0.4)
|
|
161
161
|
concurrent-ruby (~> 1.0)
|
|
162
162
|
unicode-display_width (2.1.0)
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
webrick (1.7.0)
|
|
164
|
+
yard (0.9.28)
|
|
165
|
+
webrick (~> 1.7.0)
|
|
166
|
+
zeitwerk (2.6.0)
|
|
165
167
|
|
|
166
168
|
PLATFORMS
|
|
167
169
|
ruby
|
|
@@ -175,6 +177,7 @@ DEPENDENCIES
|
|
|
175
177
|
memory_profiler
|
|
176
178
|
nokogiri
|
|
177
179
|
overcommit
|
|
180
|
+
parallel
|
|
178
181
|
rake
|
|
179
182
|
rspec
|
|
180
183
|
rubocop
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/grumlin.gemspec
CHANGED
|
@@ -29,9 +29,9 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
|
|
30
30
|
spec.add_dependency "async-pool", "~> 0.3"
|
|
31
31
|
spec.add_dependency "async-websocket", "~> 0.19"
|
|
32
|
-
spec.add_dependency "oj", "~> 3.
|
|
32
|
+
spec.add_dependency "oj", "~> 3.13"
|
|
33
33
|
spec.add_dependency "retryable", "~> 3.0"
|
|
34
|
-
spec.add_dependency "zeitwerk", "~> 2.
|
|
34
|
+
spec.add_dependency "zeitwerk", "~> 2.6"
|
|
35
35
|
spec.metadata = {
|
|
36
36
|
"rubygems_mfa_required" => "true"
|
|
37
37
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Grumlin
|
|
4
|
+
module Benchmark
|
|
5
|
+
class Repository
|
|
6
|
+
extend Grumlin::Repository
|
|
7
|
+
|
|
8
|
+
shortcut :simple_test do
|
|
9
|
+
self.V
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def simple_test
|
|
13
|
+
g.V.bytecode.serialize
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def simple_test_with_shortcut
|
|
17
|
+
g.simple_test.bytecode.serialize
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -107,13 +107,13 @@ module Grumlin
|
|
|
107
107
|
end
|
|
108
108
|
|
|
109
109
|
def already_exists_error(status)
|
|
110
|
-
return VertexAlreadyExistsError if status[:message]
|
|
111
|
-
return EdgeAlreadyExistsError if status[:message]
|
|
110
|
+
return VertexAlreadyExistsError if status[:message]&.include?(VERTEX_ALREADY_EXISTS)
|
|
111
|
+
return EdgeAlreadyExistsError if status[:message]&.include?(EDGE_ALREADY_EXISTS)
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
def concurrent_insert_error(status)
|
|
115
|
-
return ConcurrentVertexInsertFailedError if status[:message]
|
|
116
|
-
return ConcurrentEdgeInsertFailedError if status[:message]
|
|
115
|
+
return ConcurrentVertexInsertFailedError if status[:message]&.include?(CONCURRENT_VERTEX_INSERT_FAILED)
|
|
116
|
+
return ConcurrentEdgeInsertFailedError if status[:message]&.include?(CONCURRENT_EDGE_INSERT_FAILED)
|
|
117
117
|
end
|
|
118
118
|
end
|
|
119
119
|
end
|
data/lib/grumlin/typing.rb
CHANGED
|
@@ -21,7 +21,7 @@ module Grumlin
|
|
|
21
21
|
"g:T" => ->(value) { Grumlin::Expressions::T.public_send(value) }
|
|
22
22
|
}.freeze
|
|
23
23
|
|
|
24
|
-
CASTABLE_TYPES = [Hash, String, Integer, TrueClass, FalseClass].freeze
|
|
24
|
+
CASTABLE_TYPES = [Hash, String, Integer, TrueClass, FalseClass, NilClass].freeze
|
|
25
25
|
|
|
26
26
|
class << self
|
|
27
27
|
def cast(value)
|
data/lib/grumlin/version.rb
CHANGED
data/lib/grumlin.rb
CHANGED
|
@@ -21,14 +21,14 @@ require "retryable"
|
|
|
21
21
|
|
|
22
22
|
require "zeitwerk"
|
|
23
23
|
|
|
24
|
-
loader = Zeitwerk::Loader.for_gem
|
|
24
|
+
loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
|
|
25
25
|
loader.inflector.inflect(
|
|
26
26
|
"rspec" => "RSpec",
|
|
27
27
|
"db_cleaner_context" => "DBCleanerContext"
|
|
28
28
|
)
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
loader.do_not_eager_load(
|
|
30
|
+
test_helpers = "#{__dir__}/grumlin/test"
|
|
31
|
+
loader.do_not_eager_load(test_helpers)
|
|
32
32
|
|
|
33
33
|
module Grumlin
|
|
34
34
|
class Error < StandardError; end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "grumlin"
|
|
4
|
+
require "benchmark/ips"
|
|
5
|
+
|
|
6
|
+
namespace :benchmark do
|
|
7
|
+
desc "Run serialization benchmarks"
|
|
8
|
+
task :serialization do
|
|
9
|
+
repo = Grumlin::Benchmark::Repository.new
|
|
10
|
+
|
|
11
|
+
Benchmark.ips do |x|
|
|
12
|
+
x.time = 3
|
|
13
|
+
x.report("Simple") { repo.simple_test }
|
|
14
|
+
x.report("Simple shortcut") { repo.simple_test_with_shortcut }
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: grumlin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.19.
|
|
4
|
+
version: 0.19.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gleb Sinyavskiy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-06-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: async-pool
|
|
@@ -44,14 +44,14 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '3.
|
|
47
|
+
version: '3.13'
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '3.
|
|
54
|
+
version: '3.13'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: retryable
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -72,14 +72,14 @@ dependencies:
|
|
|
72
72
|
requirements:
|
|
73
73
|
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '2.
|
|
75
|
+
version: '2.6'
|
|
76
76
|
type: :runtime
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
80
|
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '2.
|
|
82
|
+
version: '2.6'
|
|
83
83
|
description: 'Gremlin graph traversal language DSL and client for Ruby. Suitable and
|
|
84
84
|
tested with gremlin-server and AWS Neptune.
|
|
85
85
|
|
|
@@ -113,6 +113,7 @@ files:
|
|
|
113
113
|
- lib/definitions.yml
|
|
114
114
|
- lib/grumlin.rb
|
|
115
115
|
- lib/grumlin/action.rb
|
|
116
|
+
- lib/grumlin/benchmark/repository.rb
|
|
116
117
|
- lib/grumlin/client.rb
|
|
117
118
|
- lib/grumlin/edge.rb
|
|
118
119
|
- lib/grumlin/expressions/column.rb
|
|
@@ -153,6 +154,7 @@ files:
|
|
|
153
154
|
- lib/grumlin/typing.rb
|
|
154
155
|
- lib/grumlin/version.rb
|
|
155
156
|
- lib/grumlin/vertex.rb
|
|
157
|
+
- lib/tasks/benchmark.rake
|
|
156
158
|
homepage: https://github.com/zhulik/grumlin
|
|
157
159
|
licenses:
|
|
158
160
|
- MIT
|