grumlin 0.1.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grumlin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Sinyavskiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-27 00:00:00.000000000 Z
11
+ date: 2021-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: async-pool
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.3'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: async-websocket
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: '0.18'
33
+ version: '0.19'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '0.18'
40
+ version: '0.19'
27
41
  description: Gremlin query language DSL for Ruby.
28
42
  email:
29
43
  - zhulik.gleb@gmail.com
@@ -33,6 +47,7 @@ extra_rdoc_files: []
33
47
  files:
34
48
  - ".github/workflows/main.yml"
35
49
  - ".gitignore"
50
+ - ".overcommit.yml"
36
51
  - ".rspec"
37
52
  - ".rubocop.yml"
38
53
  - CHANGELOG.md
@@ -43,20 +58,32 @@ files:
43
58
  - README.md
44
59
  - bin/console
45
60
  - bin/setup
46
- - bin/stress
47
61
  - docker-compose.yml
48
62
  - gremlin_server/Dockerfile
49
63
  - gremlin_server/tinkergraph-empty.properties
50
64
  - grumlin.gemspec
65
+ - lib/async/channel.rb
51
66
  - lib/grumlin.rb
67
+ - lib/grumlin/anonymous_step.rb
52
68
  - lib/grumlin/client.rb
53
69
  - lib/grumlin/edge.rb
54
70
  - lib/grumlin/exceptions.rb
71
+ - lib/grumlin/order.rb
72
+ - lib/grumlin/p.rb
73
+ - lib/grumlin/path.rb
74
+ - lib/grumlin/pop.rb
75
+ - lib/grumlin/request_dispatcher.rb
55
76
  - lib/grumlin/step.rb
77
+ - lib/grumlin/sugar.rb
78
+ - lib/grumlin/t.rb
79
+ - lib/grumlin/test/rspec.rb
80
+ - lib/grumlin/test/rspec/db_cleaner_context.rb
81
+ - lib/grumlin/test/rspec/gremlin_context.rb
56
82
  - lib/grumlin/translator.rb
83
+ - lib/grumlin/transport.rb
57
84
  - lib/grumlin/traversal.rb
58
- - lib/grumlin/traversing_context.rb
59
85
  - lib/grumlin/typing.rb
86
+ - lib/grumlin/u.rb
60
87
  - lib/grumlin/version.rb
61
88
  - lib/grumlin/vertex.rb
62
89
  homepage: https://github.com/zhulik/grumlin
@@ -81,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
108
  - !ruby/object:Gem::Version
82
109
  version: '0'
83
110
  requirements: []
84
- rubygems_version: 3.2.15
111
+ rubygems_version: 3.2.22
85
112
  signing_key:
86
113
  specification_version: 4
87
114
  summary: Gremlin query language DSL for Ruby.
data/bin/stress DELETED
@@ -1,51 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require "bundler/setup"
5
- require "grumlin"
6
- require "irb"
7
-
8
- def queries(client, uuids)
9
- total = 0
10
- g = Grumlin::Traversal.new(client)
11
-
12
- loop do
13
- uuid = uuids.sample
14
- result = g.V(uuid).toList[0]
15
- raise "!!!" if result.id != uuid
16
-
17
- total += 1
18
- end
19
- rescue Async::Stop
20
- total
21
- end
22
-
23
- def prepare_dataset(client)
24
- uuids = Array.new(1000) { SecureRandom.uuid }
25
-
26
- Grumlin::Traversal.new(client) do
27
- g.V().drop
28
-
29
- uuids.each do |uuid|
30
- g.addV("test_vertex").property(id, uuid).toList
31
- end
32
- end
33
-
34
- uuids
35
- end
36
-
37
- Async do |task|
38
- client = Grumlin::Client.new("ws://localhost:8182/gremlin", mode: :bytecode)
39
-
40
- uuids = prepare_dataset(client)
41
- tasks = Array.new(20) { task.async { queries(client, uuids) } }
42
-
43
- task.sleep(60)
44
-
45
- tasks.each(&:stop)
46
- total = tasks.sum(&:wait)
47
-
48
- p("#{total} requests performed")
49
- ensure
50
- client.disconnect
51
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Grumlin
4
- class TraversingContext
5
- ID = { :@type => "g:T", :@value => "id" }.freeze
6
-
7
- attr_reader :g
8
-
9
- def initialize(traversal)
10
- @g = traversal
11
- end
12
-
13
- def id
14
- ID
15
- end
16
- end
17
- end