dp_stm_map 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/.gitignore +18 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +622 -0
  5. data/README.md +115 -0
  6. data/Rakefile +1 -0
  7. data/bin/dp_map_manager.rb +47 -0
  8. data/cucumber.yml +2 -0
  9. data/dp_stm_map.gemspec +29 -0
  10. data/features/client_reconnect.feature +13 -0
  11. data/features/persistence.feature +12 -0
  12. data/features/replication.feature +9 -0
  13. data/features/running_manager.feature +19 -0
  14. data/features/step_definitions/client_reconnect_steps.rb +28 -0
  15. data/features/step_definitions/persistence_steps.rb +49 -0
  16. data/features/step_definitions/replication_steps.rb +15 -0
  17. data/features/step_definitions/running_server_steps.rb +10 -0
  18. data/features/step_definitions/transaction_fail_steps.rb +11 -0
  19. data/features/support/env.rb +80 -0
  20. data/features/transaction_fail.feature +7 -0
  21. data/lib/dp_stm_map/Client.rb +268 -0
  22. data/lib/dp_stm_map/ClientLocalStore.rb +119 -0
  23. data/lib/dp_stm_map/InMemoryStmMap.rb +147 -0
  24. data/lib/dp_stm_map/Manager.rb +370 -0
  25. data/lib/dp_stm_map/Message.rb +126 -0
  26. data/lib/dp_stm_map/ObjectStore.rb +99 -0
  27. data/lib/dp_stm_map/version.rb +16 -0
  28. data/lib/dp_stm_map.rb +20 -0
  29. data/server.profile +547 -0
  30. data/spec/dp_stm_map/ClientLocalStore_spec.rb +78 -0
  31. data/spec/dp_stm_map/Client_spec.rb +133 -0
  32. data/spec/dp_stm_map/InMemoryStmMap_spec.rb +10 -0
  33. data/spec/dp_stm_map/Manager_spec.rb +323 -0
  34. data/spec/dp_stm_map/Message_spec.rb +21 -0
  35. data/spec/dp_stm_map/ObjectStore_spec.rb +87 -0
  36. data/spec/dp_stm_map/StmMap_shared.rb +432 -0
  37. metadata +235 -0
data/server.profile ADDED
@@ -0,0 +1,547 @@
1
+ Thread ID: 5718000
2
+ Fiber ID: 8056700
3
+ Total: 27.451034
4
+ Sort by: self_time
5
+
6
+ %self total self wait child calls name
7
+ 0.03 0.008 0.008 0.000 0.000 1 OpenSSL::X509::Store#set_default_paths
8
+ 0.01 0.048 0.002 0.000 0.046 49 *Kernel#gem_original_require
9
+ 0.01 0.002 0.002 0.000 0.000 398 <Class::File>#file?
10
+ 0.00 0.001 0.001 0.000 0.000 7 <Class::Encoding>#find
11
+ 0.00 0.007 0.001 0.000 0.006 309 *Array#each
12
+ 0.00 0.001 0.001 0.000 0.000 998 Module#method_added
13
+ 0.00 0.000 0.000 0.000 0.000 3 Regexp#match
14
+ 0.00 0.004 0.000 0.000 0.004 129 Gem::Specification#contains_requirable_file?
15
+ 0.00 0.000 0.000 0.000 0.000 1 TCPServer#initialize
16
+ 0.00 0.001 0.000 0.000 0.000 260 *Gem::Specification#full_gem_path
17
+ 0.00 0.000 0.000 0.000 0.000 395 Symbol#to_s
18
+ 0.00 0.000 0.000 0.000 0.000 1 Thread#join
19
+ 0.00 0.000 0.000 0.000 0.000 54 IO#set_encoding
20
+ 0.00 0.000 0.000 0.000 0.000 4 <Class::Dir>#mkdir
21
+ 0.00 0.000 0.000 0.000 0.000 130 Kernel#respond_to?
22
+ 0.00 0.000 0.000 0.000 0.000 5 IO#write
23
+ 0.00 0.000 0.000 0.000 0.000 50 Module#define_method
24
+ 0.00 0.000 0.000 0.000 0.000 133 <Module::Gem>#suffixes
25
+ 0.00 0.000 0.000 0.000 0.000 1 Kernel#exit
26
+ 0.00 0.000 0.000 0.000 0.000 170 Class#inherited
27
+ 0.00 0.000 0.000 0.000 0.000 194 BasicObject#singleton_method_added
28
+ 0.00 0.000 0.000 0.000 0.000 49 <Module::Gem>#unresolved_deps
29
+ 0.00 0.000 0.000 0.000 0.000 24 Class#initialize
30
+ 0.00 0.000 0.000 0.000 0.000 10 Module#instance_methods
31
+ 0.00 0.000 0.000 0.000 0.000 17 Module#attr_accessor
32
+ 0.00 0.001 0.000 0.000 0.001 23 Module#class_eval
33
+ 0.00 27.451 0.000 0.000 27.451 2 Global#[No method]
34
+ 0.00 27.400 0.000 27.399 0.001 1 IO#each
35
+ 0.00 0.000 0.000 0.000 0.000 26 OptionParser::List#search
36
+ 0.00 0.002 0.000 0.000 0.002 60 *Class#new
37
+ 0.00 0.000 0.000 0.000 0.000 130 Kernel#respond_to_missing?
38
+ 0.00 0.000 0.000 0.000 0.000 29 Module#const_set
39
+ 0.00 0.000 0.000 0.000 0.000 11 OptionParser#visit
40
+ 0.00 0.000 0.000 0.000 0.000 30 Regexp#===
41
+ 0.00 0.000 0.000 0.000 0.000 1 File#initialize
42
+ 0.00 0.000 0.000 0.000 0.000 11 Array#reverse_each
43
+ 0.00 0.000 0.000 0.000 0.000 53 Hash#empty?
44
+ 0.00 0.000 0.000 0.000 0.000 1 Thread#raise
45
+ 0.00 0.000 0.000 0.000 0.000 26 Hash#fetch
46
+ 0.00 0.000 0.000 0.000 0.000 4 FileUtils#mkdir_p
47
+ 0.00 0.000 0.000 0.000 0.000 11 Regexp#to_s
48
+ 0.00 0.000 0.000 0.000 0.000 5 <Class::File>#exist?
49
+ 0.00 0.000 0.000 0.000 0.000 10 Array#map
50
+ 0.00 0.000 0.000 0.000 0.000 11 String#split
51
+ 0.00 0.000 0.000 0.000 0.000 17 Module#include
52
+ 0.00 0.000 0.000 0.000 0.000 1 Thread#initialize
53
+ 0.00 0.000 0.000 0.000 0.000 9 OptionParser#search
54
+ 0.00 0.000 0.000 0.000 0.000 10 <Module::JSON>#deep_const_get
55
+ 0.00 0.000 0.000 0.000 0.000 26 <Class::BasicObject>#allocate
56
+ 0.00 0.000 0.000 0.000 0.000 36 Module#===
57
+ 0.00 0.000 0.000 0.000 0.000 1 IPSocket#addr
58
+ 0.00 0.000 0.000 0.000 0.000 3 Exception#initialize
59
+ 0.00 0.001 0.000 0.000 0.001 1 Kernel#catch
60
+ 0.00 0.000 0.000 0.000 0.000 6 Module#attr_reader
61
+ 0.00 0.000 0.000 0.000 0.000 24 <Class::Class>#allocate
62
+ 0.00 0.000 0.000 0.000 0.000 2 OptionParser#make_switch
63
+ 0.00 0.000 0.000 0.000 0.000 6 OptionParser::Switch#initialize
64
+ 0.00 0.001 0.000 0.000 0.001 1 DpStmMap::Manager#stop
65
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::TransactionLog#initialize
66
+ 0.00 0.000 0.000 0.000 0.000 8 Proc#call
67
+ 0.00 0.000 0.000 0.000 0.000 17 Module#append_features
68
+ 0.00 0.001 0.000 0.000 0.001 1 DpStmMap::Manager#initialize
69
+ 0.00 0.001 0.000 0.000 0.001 1 OptionParser#initialize
70
+ 0.00 0.000 0.000 0.000 0.000 2 OptionParser::Switch#parse_arg
71
+ 0.00 0.000 0.000 0.000 0.000 1 IO#close
72
+ 0.00 0.000 0.000 0.000 0.000 30 Kernel#hash
73
+ 0.00 0.000 0.000 0.000 0.000 4 FileUtils#fu_check_options
74
+ 0.00 0.000 0.000 0.000 0.000 11 <Module::JSON>#const_defined_in?
75
+ 0.00 0.001 0.000 0.000 0.001 1 <Module::JSON>#generator=
76
+ 0.00 0.000 0.000 0.000 0.000 4 FileUtils#fu_mkdir
77
+ 0.00 0.000 0.000 0.000 0.000 4 Array#select
78
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::Thread>#new
79
+ 0.00 0.000 0.000 0.000 0.000 11 Module#const_defined?
80
+ 0.00 0.000 0.000 0.000 0.000 2 IO#puts
81
+ 0.00 0.000 0.000 0.000 0.000 4 Kernel#dup
82
+ 0.00 0.000 0.000 0.000 0.000 1 Hash#each
83
+ 0.00 0.000 0.000 0.000 0.000 3 String#%
84
+ 0.00 0.000 0.000 0.000 0.000 10 Enumerable#inject
85
+ 0.00 0.000 0.000 0.000 0.000 20 Module#const_get
86
+ 0.00 0.001 0.000 0.000 0.000 2 OptionParser::Switch::RequiredArgument#parse
87
+ 0.00 0.000 0.000 0.000 0.000 1 OpenSSL::X509::Store#initialize
88
+ 0.00 0.000 0.000 0.000 0.000 2 ThreadSafeLru::DoubleLinkedList#initialize
89
+ 0.00 0.000 0.000 0.000 0.000 4 FileUtils#fu_list
90
+ 0.00 0.000 0.000 0.000 0.000 3 JSON::Ext::Generator::State#initialize
91
+ 0.00 0.000 0.000 0.000 0.000 12 Kernel#===
92
+ 0.00 0.000 0.000 0.000 0.000 16 Kernel#block_given?
93
+ 0.00 0.000 0.000 0.000 0.000 7 Module#module_function
94
+ 0.00 0.000 0.000 0.000 0.000 2 <Class::OptionParser::Switch>#guess
95
+ 0.00 0.048 0.000 0.000 0.048 48 *Kernel#require
96
+ 0.00 0.000 0.000 0.000 0.000 2 OptionParser::List#update
97
+ 0.00 0.000 0.000 0.000 0.000 1 Gem::Specification#activate
98
+ 0.00 0.000 0.000 0.000 0.000 12 Module#private
99
+ 0.00 0.000 0.000 0.000 0.000 2 ThreadSafeLru::LruCache#initialize
100
+ 0.00 0.000 0.000 0.000 0.000 2 Kernel#puts
101
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::OpenSSL::X509::Store>#allocate
102
+ 0.00 0.000 0.000 0.000 0.000 2 OptionParser::List#initialize
103
+ 0.00 0.000 0.000 0.000 0.000 13 Hash#delete
104
+ 0.00 0.000 0.000 0.000 0.000 4 Array#flatten
105
+ 0.00 0.000 0.000 0.000 0.000 8 String#chomp
106
+ 0.00 0.000 0.000 0.000 0.000 4 ThreadSafeLru::ListNode#initialize
107
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::Exception>#exception
108
+ 0.00 0.000 0.000 0.000 0.000 2 OptionParser#define
109
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::IO>#open
110
+ 0.00 0.000 0.000 0.000 0.000 16 Module#included
111
+ 0.00 0.000 0.000 0.000 0.000 2 IO#flush
112
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::Manager#start
113
+ 0.00 0.000 0.000 0.000 0.000 4 Gem::Specification#runtime_dependencies
114
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::ReferenceCounts#initialize
115
+ 0.00 0.000 0.000 0.000 0.000 3 OptionParser#notwice
116
+ 0.00 0.000 0.000 0.000 0.000 2 OptionParser::List#append
117
+ 0.00 0.000 0.000 0.000 0.000 7 Hash#[]=
118
+ 0.00 0.001 0.000 0.000 0.001 1 OptionParser#permute!
119
+ 0.00 0.000 0.000 0.000 0.000 8 Gem::Dependency#type
120
+ 0.00 0.000 0.000 0.000 0.000 1 Gem::Specification#raise_if_conflicts
121
+ 0.00 0.000 0.000 0.000 0.000 1 Gem::Specification#add_self_to_load_path
122
+ 0.00 0.000 0.000 0.000 0.000 4 Kernel#initialize_dup
123
+ 0.00 0.000 0.000 0.000 0.000 12 Symbol#===
124
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::Manager#port
125
+ 0.00 0.000 0.000 0.000 0.000 8 <Class::Hash>#allocate
126
+ 0.00 0.000 0.000 0.000 0.000 4 <Class::Proc>#new
127
+ 0.00 0.000 0.000 0.000 0.000 2 OptionParser::Switch#conv_arg
128
+ 0.00 0.000 0.000 0.000 0.000 12 BasicObject#==
129
+ 0.00 0.000 0.000 0.000 0.000 4 Kernel#method
130
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::CurrentValues#initialize
131
+ 0.00 0.000 0.000 0.000 0.000 2 Exception#set_backtrace
132
+ 0.00 0.000 0.000 0.000 0.000 1 OptionParser#banner
133
+ 0.00 0.000 0.000 0.000 0.000 1 Array#[]=
134
+ 0.00 0.001 0.000 0.000 0.001 1 OptionParser#parse_in_order
135
+ 0.00 0.000 0.000 0.000 0.000 3 OptionParser::List#add_banner
136
+ 0.00 0.004 0.000 0.000 0.004 1 <Module::Gem>#try_activate
137
+ 0.00 0.000 0.000 0.000 0.000 4 Hash#invert
138
+ 0.00 0.000 0.000 0.000 0.000 3 Exception#exception
139
+ 0.00 0.000 0.000 0.000 0.000 4 Hash#keys
140
+ 0.00 0.000 0.000 0.000 0.000 3 Exception#backtrace
141
+ 0.00 0.000 0.000 0.000 0.000 4 <Class::File>#path
142
+ 0.00 0.000 0.000 0.000 0.000 1 OpenSSL::X509::Store#flags=
143
+ 0.00 0.000 0.000 0.000 0.000 4 <Class::Mutex>#allocate
144
+ 0.00 0.000 0.000 0.000 0.000 2 OptionParser#on
145
+ 0.00 0.000 0.000 0.000 0.000 10 String#empty?
146
+ 0.00 0.000 0.000 0.000 0.000 1 Module#constants
147
+ 0.00 0.000 0.000 0.000 0.000 1 SystemExit#initialize
148
+ 0.00 0.000 0.000 0.000 0.000 5 Array#shift
149
+ 0.00 0.000 0.000 0.000 0.000 7 Array#empty?
150
+ 0.00 0.000 0.000 0.000 0.000 3 Method#to_proc
151
+ 0.00 0.000 0.000 0.000 0.000 2 Array#delete_if
152
+ 0.00 0.000 0.000 0.000 0.000 4 Array#push
153
+ 0.00 0.000 0.000 0.000 0.000 1 <Module::JSON>#parser=
154
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::Gem::Specification>#_all
155
+ 0.00 0.000 0.000 0.000 0.000 5 String#==
156
+ 0.00 0.000 0.000 0.000 0.000 2 <Class::IO>#allocate
157
+ 0.00 0.000 0.000 0.000 0.000 1 Gem::Specification#activate_dependencies
158
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::IO>#new
159
+ 0.00 0.001 0.000 0.000 0.001 1 OptionParser#parse!
160
+ 0.00 0.000 0.000 0.000 0.000 4 Gem::Specification#dependencies
161
+ 0.00 0.000 0.000 0.000 0.000 1 <Module::Gem>#load_path_insert_index
162
+ 0.00 0.000 0.000 0.000 0.000 8 Symbol#==
163
+ 0.00 0.004 0.000 0.000 0.004 1 <Class::Gem::Specification>#each
164
+ 0.00 0.000 0.000 0.000 0.000 4 Hash#initialize_copy
165
+ 0.00 0.000 0.000 0.000 0.000 1 <Object::Object>#include?
166
+ 0.00 0.000 0.000 0.000 0.000 3 <Class::JSON::Ext::Generator::State>#allocate
167
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::Range>#allocate
168
+ 0.00 0.000 0.000 0.000 0.000 1 Gem::Specification#conflicts
169
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::File>#basename
170
+ 0.00 0.000 0.000 0.000 0.000 3 Enumerable#find_all
171
+ 0.00 0.000 0.000 0.000 0.000 1 Array#index
172
+ 0.00 0.000 0.000 0.000 0.000 2 OptionParser#top
173
+ 0.00 0.000 0.000 0.000 0.000 4 Mutex#initialize
174
+ 0.00 0.000 0.000 0.000 0.000 3 Kernel#lambda
175
+ 0.00 0.000 0.000 0.000 0.000 1 OptionParser#add_officious
176
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::File>#join
177
+ 0.00 0.000 0.000 0.000 0.000 4 Hash#[]
178
+ 0.00 0.000 0.000 0.000 0.000 1 ConditionVariable#initialize
179
+ 0.00 0.000 0.000 0.000 0.000 1 OptionParser#program_name
180
+ 0.00 0.000 0.000 0.000 0.000 2 String#rindex
181
+ 0.00 0.000 0.000 0.000 0.000 4 Hash#initialize
182
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::ClientTransactionManager#initialize
183
+ 0.00 0.000 0.000 0.000 0.000 2 MatchData#to_a
184
+ 0.00 0.000 0.000 0.000 0.000 4 Hash#key?
185
+ 0.00 0.000 0.000 0.000 0.000 1 String#start_with?
186
+ 0.00 0.004 0.000 0.000 0.004 1 Enumerable#find
187
+ 0.00 0.000 0.000 0.000 0.000 3 String#to_i
188
+ 0.00 0.000 0.000 0.000 0.000 1 Kernel#Integer
189
+ 0.00 0.000 0.000 0.000 0.000 1 Module#extend_object
190
+ 0.00 0.000 0.000 0.000 0.000 2 Exception#message
191
+ 0.00 0.000 0.000 0.000 0.000 1 Kernel#extend
192
+ 0.00 0.004 0.000 0.000 0.004 1 <Class::Gem::Specification>#find_by_path
193
+ 0.00 0.000 0.000 0.000 0.000 4 BasicObject#initialize
194
+ 0.00 0.000 0.000 0.000 0.000 1 <Module::JSON::Ext::Generator::GeneratorMethods::String>#included
195
+ 0.00 0.000 0.000 0.000 0.000 1 Hash#values
196
+ 0.00 0.001 0.000 0.000 0.001 1 OptionParser#order!
197
+ 0.00 0.000 0.000 0.000 0.000 2 Float#/
198
+ 0.00 0.000 0.000 0.000 0.000 2 Module#>=
199
+ 0.00 0.000 0.000 0.000 0.000 1 Array#insert
200
+ 0.00 0.000 0.000 0.000 0.000 1 OptionParser#base
201
+ 0.00 0.000 0.000 0.000 0.000 1 Fixnum#to_s
202
+ 0.00 0.000 0.000 0.000 0.000 2 Exception#to_s
203
+ 0.00 0.000 0.000 0.000 0.000 2 Module#public
204
+ 0.00 0.000 0.000 0.000 0.000 2 Hash#update
205
+ 0.00 0.000 0.000 0.000 0.000 1 String#*
206
+ 0.00 0.000 0.000 0.000 0.000 1 Method#arity
207
+ 0.00 0.000 0.000 0.000 0.000 2 String#===
208
+ 0.00 0.000 0.000 0.000 0.000 1 Module#method_defined?
209
+ 0.00 0.000 0.000 0.000 0.000 2 <Class::OptionParser::Switch::NoArgument>#incompatible_argument_styles
210
+ 0.00 0.000 0.000 0.000 0.000 1 Module#protected
211
+ 0.00 0.000 0.000 0.000 0.000 1 Float#-@
212
+ 0.00 0.000 0.000 0.000 0.000 1 String#end_with?
213
+ 0.00 0.000 0.000 0.000 0.000 1 Module#extended
214
+
215
+ * indicates recursively called methods
216
+ Thread ID: 7748740
217
+ Fiber ID: 7760740
218
+ Total: 27.400595
219
+ Sort by: self_time
220
+
221
+ %self total self wait child calls name
222
+ 0.00 27.399 0.000 27.399 0.000 3 TCPServer#accept
223
+ 0.00 27.401 0.000 0.001 27.399 1 DpStmMap::Manager#start
224
+ 0.00 0.000 0.000 0.000 0.000 2 Thread#initialize
225
+ 0.00 0.000 0.000 0.000 0.000 2 <Class::Thread>#new
226
+ 0.00 27.399 0.000 0.000 27.399 1 Kernel#loop
227
+ 0.00 0.000 0.000 0.000 0.000 2 BasicSocket#setsockopt
228
+ 0.00 0.000 0.000 0.000 0.000 1 IO#close
229
+ 0.00 0.000 0.000 0.000 0.000 2 <Class::IO>#allocate
230
+ 0.00 0.000 0.000 0.000 0.000 1 Array#each
231
+ 0.00 0.000 0.000 0.000 0.000 1 Exception#exception
232
+ 0.00 0.000 0.000 0.000 0.000 1 Exception#set_backtrace
233
+ 0.00 0.000 0.000 0.000 0.000 2 Thread#join
234
+ 0.00 0.000 0.000 0.000 0.000 2 Thread#raise
235
+ 0.00 0.000 0.000 0.000 0.000 1 Exception#backtrace
236
+ 0.00 0.000 0.000 0.000 0.000 1 IO#closed?
237
+ 0.00 0.000 0.000 0.000 0.000 1 Module#===
238
+
239
+ * indicates recursively called methods
240
+ Thread ID: 7760640
241
+ Fiber ID: 7760040
242
+ Total: 27.400287
243
+ Sort by: self_time
244
+
245
+ %self total self wait child calls name
246
+ 8.53 3.984 2.338 1.646 0.000 40004 File#initialize
247
+ 4.81 1.991 1.317 0.653 0.021 60008 IO#write
248
+ 4.78 1.531 1.310 0.000 0.221 10001 JSON::Ext::Generator::GeneratorMethods::Array#to_json
249
+ 3.48 1.221 0.955 0.266 0.000 40005 IO#close
250
+ 3.06 0.839 0.839 0.000 0.000 10002 JSON::Ext::Parser#parse
251
+ 2.24 7.393 0.613 6.780 0.000 20005 IO#read
252
+ 1.85 2.259 0.508 1.751 0.000 60006 Mutex#lock
253
+ 1.83 8.267 0.503 0.000 7.764 40004 <Class::IO>#open
254
+ 1.55 0.424 0.424 0.000 0.000 30003 <Class::File>#exist?
255
+ 1.42 7.058 0.389 0.000 6.669 30004 Hash#each
256
+ 1.31 17.413 0.358 0.000 17.055 60006 *Mutex#synchronize
257
+ 1.22 1.633 0.334 0.000 1.299 100016 *Class#new
258
+ 0.98 9.853 0.268 0.001 9.584 10003 DpStmMap::SocketTransport#next_message
259
+ 0.81 0.396 0.223 0.000 0.174 10002 JSON::Ext::Parser#initialize
260
+ 0.75 2.092 0.204 0.000 1.888 10002 DpStmMap::SocketTransport#send_message
261
+ 0.71 0.354 0.195 0.000 0.158 40006 Array#each
262
+ 0.64 2.132 0.175 0.000 1.957 10002 <Class::DpStmMap::JsonMessage>#deserialize
263
+ 0.63 0.172 0.172 0.000 0.000 90011 String#encode
264
+ 0.63 0.411 0.172 0.000 0.239 10002 JSON::Ext::Generator::GeneratorMethods::Hash#to_json
265
+ 0.60 12.550 0.163 0.000 12.387 10001 DpStmMap::ClientTransactionManager#apply_transaction
266
+ 0.56 0.154 0.154 0.000 0.000 70008 Hash#[]=
267
+ 0.55 0.152 0.152 0.000 0.000 90018 Hash#key?
268
+ 0.54 0.519 0.148 0.000 0.371 20002 Set#initialize
269
+ 0.47 0.535 0.130 0.000 0.405 10001 ThreadSafeLru::LruCache#get_node
270
+ 0.47 0.788 0.128 0.000 0.660 10002 DpStmMap::JsonMessage#serialize
271
+ 0.41 0.112 0.112 0.000 0.000 30003 DpStmMap::ReferenceCounts#file_name
272
+ 0.39 0.258 0.107 0.000 0.151 30004 Kernel#dup
273
+ 0.39 0.107 0.107 0.000 0.000 60006 Mutex#unlock
274
+ 0.32 27.399 0.088 0.002 27.310 1 Kernel#loop
275
+ 0.32 1.337 0.087 0.000 1.250 10001 DpStmMap::ReferenceCounts#add_reference
276
+ 0.31 1.462 0.085 0.000 1.377 10002 JSON#parse
277
+ 0.30 3.684 0.081 0.000 3.603 10001 DpStmMap::CurrentValues#[]=
278
+ 0.30 0.197 0.081 0.000 0.116 10001 Set#merge
279
+ 0.28 0.078 0.078 0.000 0.000 20002 DpStmMap::CurrentValues#file_name
280
+ 0.28 0.077 0.077 0.000 0.000 60011 <Class::BasicObject>#allocate
281
+ 0.27 0.363 0.074 0.000 0.288 10001 ConditionVariable#broadcast
282
+ 0.26 0.071 0.071 0.000 0.000 40005 Hash#keys
283
+ 0.25 0.067 0.067 0.000 0.000 10001 ThreadSafeLru::ListNode#remove
284
+ 0.23 0.103 0.063 0.000 0.040 30004 Kernel#initialize_dup
285
+ 0.22 0.237 0.062 0.000 0.175 10001 DpStmMap::ReferenceCounts#has_references?
286
+ 0.22 0.119 0.061 0.000 0.058 10001 ThreadSafeLru::Node#initialize
287
+ 0.22 0.061 0.061 0.000 0.000 30003 Fixnum#to_s
288
+ 0.22 0.061 0.061 0.000 0.000 20002 Hash#initialize
289
+ 0.22 0.060 0.060 0.000 0.000 10002 String#unpack
290
+ 0.22 2.886 0.059 0.000 2.827 10001 DpStmMap::TransactionLog#write_tx
291
+ 0.21 0.112 0.059 0.000 0.053 10001 Set#each
292
+ 0.21 0.059 0.059 0.000 0.000 10001 ThreadSafeLru::ListNode#insert_between
293
+ 0.21 0.181 0.058 0.000 0.122 10001 ThreadSafeLru::DoubleLinkedList#add_to_head
294
+ 0.21 1.197 0.058 0.000 1.138 10001 ThreadSafeLru::LruCache#get
295
+ 0.19 0.324 0.053 0.000 0.271 10001 Proc#call
296
+ 0.19 0.053 0.053 0.000 0.000 20003 Hash#delete
297
+ 0.19 0.052 0.052 0.000 0.000 10002 <Class::JSON::Ext::Parser>#allocate
298
+ 0.18 0.049 0.049 0.000 0.000 20005 Module#===
299
+ 0.18 0.048 0.048 0.000 0.000 30004 Kernel#instance_variable_set
300
+ 0.17 0.074 0.048 0.000 0.026 10001 DpStmMap::ClientTransactionSuccessfulMessage#initialize
301
+ 0.17 0.095 0.047 0.000 0.049 10001 Set#do_with_enum
302
+ 0.17 0.047 0.047 0.000 0.000 40004 <Class::IO>#allocate
303
+ 0.17 1.242 0.046 0.000 1.197 10001 DpStmMap::CurrentValues#[]
304
+ 0.16 0.045 0.045 0.000 0.000 20004 Module#const_get
305
+ 0.16 17.457 0.044 0.000 17.413 10001 DpStmMap::ClientHandler#handle
306
+ 0.16 0.043 0.043 0.000 0.000 10001 Hash#each_key
307
+ 0.15 0.218 0.041 0.000 0.176 10002 <Class::DpStmMap::JsonMessage>#class_from_string
308
+ 0.15 0.041 0.041 0.000 0.000 10002 String#split
309
+ 0.15 0.041 0.041 0.000 0.000 10001 DpStmMap::ClientTransactionMessage#initialize
310
+ 0.14 0.038 0.038 0.000 0.000 20002 Hash#has_key?
311
+ 0.14 0.149 0.037 0.000 0.112 10001 Enumerable#select
312
+ 0.14 0.054 0.037 0.000 0.017 10001 Set#add
313
+ 0.13 0.036 0.036 0.000 0.000 3244 Thread#run
314
+ 0.13 0.035 0.035 0.000 0.000 20003 <Class::JSON::Ext::Generator::State>#allocate
315
+ 0.12 0.273 0.034 0.000 0.239 10001 ThreadSafeLru::LruCache#drop
316
+ 0.12 0.032 0.032 0.000 0.000 10002 Array#pack
317
+ 0.12 0.032 0.032 0.000 0.000 30004 String#to_s
318
+ 0.12 4.605 0.032 0.000 4.573 10001 DpStmMap::TransactionLog#store_transaction
319
+ 0.11 0.436 0.030 0.000 0.406 10001 Enumerable#to_set
320
+ 0.11 0.030 0.030 0.000 0.000 10002 Kernel#instance_variables
321
+ 0.10 0.043 0.028 0.000 0.015 10001 Set#to_a
322
+ 0.10 0.493 0.028 0.000 0.465 10001 ThreadSafeLru::Node#get_value
323
+ 0.10 0.028 0.028 0.000 0.000 20002 Kernel#instance_variable_get
324
+ 0.10 0.136 0.028 0.000 0.108 10002 Enumerable#inject
325
+ 0.10 0.163 0.027 0.000 0.136 10002 DpStmMap::JsonMessage#from_hash!
326
+ 0.10 0.027 0.027 0.000 0.000 20002 Symbol#to_s
327
+ 0.10 0.026 0.026 0.000 0.000 10001 DpStmMap::ClientTransactionOutcomeMessage#initialize
328
+ 0.09 0.025 0.025 0.000 0.000 20003 JSON::Ext::Generator::State#initialize_copy
329
+ 0.09 0.024 0.024 0.000 0.000 10002 IO#flush
330
+ 0.09 0.024 0.024 0.000 0.000 20002 <Class::Hash>#allocate
331
+ 0.09 0.023 0.023 0.000 0.000 20003 Kernel#class
332
+ 0.08 0.034 0.022 0.000 0.011 10001 Enumerable#each_entry
333
+ 0.08 0.022 0.022 0.000 0.000 10002 String#encoding
334
+ 0.07 0.020 0.020 0.000 0.000 10001 ThreadSafeLru::ListNode#initialize
335
+ 0.07 0.020 0.020 0.000 0.000 10001 ThreadSafeLru::LruCache#size
336
+ 0.07 0.019 0.019 0.000 0.000 10002 <Class::Mutex>#allocate
337
+ 0.06 0.018 0.018 0.000 0.000 10002 Module#name
338
+ 0.06 0.017 0.017 0.000 0.000 10001 DpStmMap::TransactionLog#last_id
339
+ 0.06 0.015 0.015 0.000 0.000 10001 Array#initialize_copy
340
+ 0.05 0.015 0.015 0.000 0.000 10001 Kernel#respond_to?
341
+ 0.05 0.013 0.013 0.000 0.000 10001 <Class::Array>#allocate
342
+ 0.04 0.012 0.012 0.000 0.000 10001 NilClass#nil?
343
+ 0.04 0.011 0.011 0.000 0.000 10002 String#bytesize
344
+ 0.04 0.011 0.011 0.000 0.000 10001 Kernel#nil?
345
+ 0.04 0.011 0.011 0.000 0.000 10001 Array#clear
346
+ 0.04 0.011 0.011 0.000 0.000 10001 Kernel#block_given?
347
+ 0.04 0.010 0.010 0.000 0.000 10002 Mutex#initialize
348
+ 0.04 0.010 0.010 0.000 0.000 10001 Kernel#instance_of?
349
+ 0.00 0.000 0.000 0.000 0.000 1 BasicObject#method_missing
350
+ 0.00 27.400 0.000 0.000 27.400 1 DpStmMap::Manager#start
351
+ 0.00 0.000 0.000 0.000 0.000 1 Thread#initialize
352
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::Thread>#new
353
+ 0.00 0.000 0.000 0.000 0.000 1 Exception#initialize
354
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::ClientHandler#initialize
355
+ 0.00 0.000 0.000 0.000 0.000 1 NameError#initialize
356
+ 0.00 0.000 0.000 0.000 0.000 1 NoMethodError#initialize
357
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::TransactionLog#add_listener
358
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::ClientHelloMessage#initialize
359
+ 0.00 0.000 0.000 0.000 0.000 1 Exception#exception
360
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::SocketTransport#initialize
361
+ 0.00 0.000 0.000 0.000 0.000 1 Exception#set_backtrace
362
+ 0.00 0.000 0.000 0.000 0.000 1 BasicObject#initialize
363
+ 0.00 0.000 0.000 0.000 0.000 1 Exception#backtrace
364
+
365
+ * indicates recursively called methods
366
+ Thread ID: 7765200
367
+ Fiber ID: 7764540
368
+ Total: 27.399141
369
+ Sort by: self_time
370
+
371
+ %self total self wait child calls name
372
+ 3.61 1.394 0.989 0.000 0.405 10001 JSON::Ext::Generator::GeneratorMethods::Hash#to_json
373
+ 2.96 0.811 0.811 0.000 0.000 10001 JSON::Ext::Parser#parse
374
+ 2.38 2.920 0.653 2.267 0.000 20002 IO#write
375
+ 1.75 1.365 0.479 0.886 0.000 10001 IO#read
376
+ 1.70 27.119 0.466 0.000 26.653 26492 *Mutex#synchronize
377
+ 1.15 2.097 0.316 1.781 0.000 10001 File#initialize
378
+ 1.02 3.877 0.279 0.001 3.598 10001 <Class::IO>#open
379
+ 0.93 7.470 0.254 7.216 0.000 26492 Mutex#lock
380
+ 0.82 0.224 0.224 0.000 0.000 110011 String#encode
381
+ 0.71 5.110 0.195 0.000 4.915 10001 DpStmMap::SocketTransport#send_message
382
+ 0.69 0.380 0.190 0.000 0.190 10001 JSON::Ext::Parser#initialize
383
+ 0.58 0.297 0.160 0.000 0.137 10001 Array#each
384
+ 0.54 1.940 0.147 0.000 1.793 10001 DpStmMap::JsonMessage#serialize
385
+ 0.50 0.137 0.137 0.000 0.000 10001 <Class::JSON::Ext::Parser>#allocate
386
+ 0.47 5.519 0.130 0.000 5.389 10001 DpStmMap::TransactionLog#read_tx
387
+ 0.47 0.129 0.129 0.000 0.000 90009 Hash#key?
388
+ 0.44 0.120 0.120 0.000 0.000 10001 IO#close
389
+ 0.44 27.399 0.120 0.000 27.280 1 Kernel#loop
390
+ 0.42 0.705 0.115 0.000 0.589 20002 Class#new
391
+ 0.39 0.107 0.107 0.000 0.000 50005 Hash#[]=
392
+ 0.31 1.487 0.085 0.000 1.402 10001 JSON#parse
393
+ 0.29 8.206 0.078 8.128 0.000 3245 Mutex#sleep
394
+ 0.26 0.072 0.072 0.000 0.000 26491 Mutex#unlock
395
+ 0.25 8.434 0.070 0.000 8.365 3245 ConditionVariable#wait
396
+ 0.22 0.059 0.059 0.000 0.000 10001 DpStmMap::TransactionMessage#initialize
397
+ 0.21 0.057 0.057 0.000 0.000 40004 Symbol#to_s
398
+ 0.19 0.053 0.053 0.000 0.000 30003 Hash#keys
399
+ 0.19 0.052 0.052 0.000 0.000 40004 Kernel#instance_variable_get
400
+ 0.19 0.051 0.051 0.000 0.000 10001 Kernel#instance_variables
401
+ 0.17 12.920 0.046 0.000 12.874 10001 DpStmMap::ClientHandler#handle
402
+ 0.15 0.040 0.040 0.000 0.000 20002 Module#===
403
+ 0.13 0.084 0.036 0.000 0.048 10001 Kernel#dup
404
+ 0.13 0.035 0.035 0.000 0.000 13246 DpStmMap::TransactionLog#last_id
405
+ 0.11 0.030 0.030 0.000 0.000 30003 String#to_s
406
+ 0.10 0.026 0.026 0.000 0.000 10001 Array#pack
407
+ 0.09 0.025 0.025 0.000 0.000 10001 Fixnum#to_s
408
+ 0.07 0.033 0.020 0.000 0.012 10001 Kernel#initialize_dup
409
+ 0.07 0.019 0.019 0.000 0.000 10001 String#encoding
410
+ 0.06 0.018 0.018 0.000 0.000 10001 IO#flush
411
+ 0.06 0.017 0.017 0.000 0.000 10001 Module#name
412
+ 0.06 0.016 0.016 0.000 0.000 10001 <Class::IO>#allocate
413
+ 0.05 0.015 0.015 0.000 0.000 10001 <Class::JSON::Ext::Generator::State>#allocate
414
+ 0.05 0.012 0.012 0.000 0.000 10001 <Class::BasicObject>#allocate
415
+ 0.05 0.012 0.012 0.000 0.000 10001 JSON::Ext::Generator::State#initialize_copy
416
+ 0.04 0.012 0.012 0.000 0.000 10001 Kernel#class
417
+ 0.04 0.011 0.011 0.000 0.000 6489 <Class::Thread>#current
418
+ 0.04 0.011 0.011 0.000 0.000 10001 String#bytesize
419
+ 0.04 0.010 0.010 0.000 0.000 3244 Array#delete
420
+ 0.02 0.005 0.005 0.000 0.000 3245 Array#push
421
+ 0.00 27.399 0.000 0.000 27.399 1 DpStmMap::TransactionLog#add_listener
422
+
423
+ * indicates recursively called methods
424
+ Thread ID: 6944240
425
+ Fiber ID: 6943940
426
+ Total: 3.979241
427
+ Sort by: self_time
428
+
429
+ %self total self wait child calls name
430
+ 0.01 3.979 0.000 0.002 3.977 1 Kernel#loop
431
+ 0.00 3.977 0.000 3.977 0.000 3 IO#read
432
+ 0.00 0.000 0.000 0.000 0.000 1 BasicObject#method_missing
433
+ 0.00 0.000 0.000 0.000 0.000 1 IO#close
434
+ 0.00 0.000 0.000 0.000 0.000 2 IO#write
435
+ 0.00 3.979 0.000 0.000 3.979 1 DpStmMap::Manager#start
436
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::Thread>#new
437
+ 0.00 3.977 0.000 0.000 3.977 2 DpStmMap::SocketTransport#next_message
438
+ 0.00 0.000 0.000 0.000 0.000 1 Thread#initialize
439
+ 0.00 0.000 0.000 0.000 0.000 6 *Class#new
440
+ 0.00 0.000 0.000 0.000 0.000 1 Exception#initialize
441
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::SocketTransport#send_message
442
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::DpStmMap::JsonMessage>#deserialize
443
+ 0.00 0.000 0.000 0.000 0.000 2 Array#each
444
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::JsonMessage#serialize
445
+ 0.00 0.000 0.000 0.000 0.000 1 JSON::Ext::Parser#initialize
446
+ 0.00 0.000 0.000 0.000 0.000 1 JSON::Ext::Parser#parse
447
+ 0.00 0.000 0.000 0.000 0.000 1 JSON::Ext::Generator::GeneratorMethods::Hash#to_json
448
+ 0.00 0.000 0.000 0.000 0.000 1 NameError#initialize
449
+ 0.00 0.000 0.000 0.000 0.000 1 JSON#parse
450
+ 0.00 0.000 0.000 0.000 0.000 5 <Class::BasicObject>#allocate
451
+ 0.00 0.000 0.000 0.000 0.000 1 Exception#backtrace
452
+ 0.00 0.000 0.000 0.000 0.000 9 Hash#key?
453
+ 0.00 0.000 0.000 0.000 0.000 1 String#unpack
454
+ 0.00 0.000 0.000 0.000 0.000 1 NoMethodError#initialize
455
+ 0.00 0.000 0.000 0.000 0.000 3 Module#===
456
+ 0.00 0.000 0.000 0.000 0.000 2 Module#const_get
457
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::ClientHandler#initialize
458
+ 0.00 0.000 0.000 0.000 0.000 1 Exception#set_backtrace
459
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::TransactionLog#add_listener
460
+ 0.00 0.000 0.000 0.000 0.000 2 String#encode
461
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::ClientHelloMessage#initialize
462
+ 0.00 0.000 0.000 0.000 0.000 1 Kernel#dup
463
+ 0.00 0.000 0.000 0.000 0.000 1 Hash#each
464
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::DpStmMap::JsonMessage>#class_from_string
465
+ 0.00 0.000 0.000 0.000 0.000 1 String#split
466
+ 0.00 0.000 0.000 0.000 0.000 1 IO#flush
467
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::SocketTransport#initialize
468
+ 0.00 0.000 0.000 0.000 0.000 1 Exception#exception
469
+ 0.00 0.000 0.000 0.000 0.000 1 DpStmMap::JsonMessage#from_hash!
470
+ 0.00 0.000 0.000 0.000 0.000 1 Hash#delete
471
+ 0.00 0.000 0.000 0.000 0.000 1 Enumerable#inject
472
+ 0.00 0.000 0.000 0.000 0.000 1 Kernel#instance_variable_set
473
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::JSON::Ext::Parser>#allocate
474
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::Mutex>#allocate
475
+ 0.00 0.000 0.000 0.000 0.000 1 Array#pack
476
+ 0.00 0.000 0.000 0.000 0.000 1 Kernel#initialize_dup
477
+ 0.00 0.000 0.000 0.000 0.000 1 Hash#[]=
478
+ 0.00 0.000 0.000 0.000 0.000 1 String#encoding
479
+ 0.00 0.000 0.000 0.000 0.000 1 Module#name
480
+ 0.00 0.000 0.000 0.000 0.000 1 Hash#keys
481
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::JSON::Ext::Generator::State>#allocate
482
+ 0.00 0.000 0.000 0.000 0.000 1 String#bytesize
483
+ 0.00 0.000 0.000 0.000 0.000 1 Kernel#instance_variables
484
+ 0.00 0.000 0.000 0.000 0.000 1 JSON::Ext::Generator::State#initialize_copy
485
+ 0.00 0.000 0.000 0.000 0.000 1 BasicObject#initialize
486
+ 0.00 0.000 0.000 0.000 0.000 1 Kernel#class
487
+ 0.00 0.000 0.000 0.000 0.000 1 Mutex#initialize
488
+ 0.00 0.000 0.000 0.000 0.000 1 String#to_s
489
+
490
+ * indicates recursively called methods
491
+ Thread ID: 6940620
492
+ Fiber ID: 6940400
493
+ Total: 3.978802
494
+ Sort by: self_time
495
+
496
+ %self total self wait child calls name
497
+ 31.73 1.557 1.262 0.000 0.295 10001 JSON::Ext::Generator::GeneratorMethods::Hash#to_json
498
+ 12.09 0.481 0.481 0.000 0.000 10001 JSON::Ext::Parser#parse
499
+ 8.52 0.339 0.339 0.000 0.000 20002 IO#write
500
+ 4.91 3.814 0.195 0.000 3.619 20004 *Mutex#synchronize
501
+ 3.78 0.150 0.150 0.000 0.000 110011 String#encode
502
+ 3.07 0.122 0.122 0.000 0.000 10001 IO#read
503
+ 2.58 0.179 0.103 0.000 0.076 10001 Array#each
504
+ 2.51 2.359 0.100 0.000 2.260 10001 DpStmMap::SocketTransport#send_message
505
+ 2.50 0.100 0.100 0.000 0.000 10001 File#initialize
506
+ 2.50 0.198 0.099 0.000 0.098 10001 JSON::Ext::Parser#initialize
507
+ 2.37 1.881 0.094 0.000 1.786 10001 DpStmMap::JsonMessage#serialize
508
+ 1.77 0.340 0.070 0.000 0.269 10001 <Class::IO>#open
509
+ 1.69 0.067 0.067 0.000 0.000 90009 Hash#key?
510
+ 1.63 1.179 0.065 0.000 1.114 10001 DpStmMap::TransactionLog#read_tx
511
+ 1.49 3.979 0.059 0.000 3.919 1 Kernel#loop
512
+ 1.44 0.322 0.057 0.000 0.265 20002 Class#new
513
+ 1.40 0.056 0.056 0.000 0.000 50005 Hash#[]=
514
+ 1.10 0.044 0.044 0.000 0.000 10001 DpStmMap::TransactionMessage#initialize
515
+ 1.05 0.042 0.042 0.000 0.000 40004 Symbol#to_s
516
+ 0.97 0.760 0.039 0.000 0.721 10001 JSON#parse
517
+ 0.96 0.038 0.038 0.000 0.000 10001 IO#close
518
+ 0.94 0.037 0.037 0.000 0.000 30003 Hash#keys
519
+ 0.84 0.034 0.034 0.000 0.000 40004 Kernel#instance_variable_get
520
+ 0.68 0.062 0.027 0.000 0.036 10001 Kernel#dup
521
+ 0.59 0.024 0.024 0.000 0.000 30003 String#to_s
522
+ 0.58 2.522 0.023 0.000 2.499 10001 DpStmMap::ClientHandler#handle
523
+ 0.53 0.021 0.021 0.000 0.000 20003 Mutex#unlock
524
+ 0.52 0.021 0.021 0.000 0.000 20004 Mutex#lock
525
+ 0.52 0.021 0.021 0.000 0.000 20002 Module#===
526
+ 0.49 0.019 0.019 0.000 0.000 10001 Array#pack
527
+ 0.45 0.018 0.018 0.000 0.000 10001 Kernel#instance_variables
528
+ 0.40 0.016 0.016 0.000 0.000 10002 DpStmMap::TransactionLog#last_id
529
+ 0.39 0.025 0.016 0.000 0.009 10001 Kernel#initialize_dup
530
+ 0.38 0.015 0.015 0.000 0.000 10001 Fixnum#to_s
531
+ 0.37 0.015 0.015 0.000 0.000 10001 <Class::JSON::Ext::Parser>#allocate
532
+ 0.28 0.011 0.011 0.000 0.000 10001 IO#flush
533
+ 0.28 0.011 0.011 0.000 0.000 10001 Module#name
534
+ 0.27 0.011 0.011 0.000 0.000 10001 <Class::JSON::Ext::Generator::State>#allocate
535
+ 0.26 0.010 0.010 0.000 0.000 10001 String#encoding
536
+ 0.23 0.009 0.009 0.000 0.000 10001 String#bytesize
537
+ 0.23 0.009 0.009 0.000 0.000 10001 JSON::Ext::Generator::State#initialize_copy
538
+ 0.22 0.009 0.009 0.000 0.000 10001 <Class::IO>#allocate
539
+ 0.22 0.009 0.009 0.000 0.000 10001 <Class::BasicObject>#allocate
540
+ 0.22 0.009 0.009 0.000 0.000 10001 Kernel#class
541
+ 0.01 0.002 0.000 0.002 0.000 1 Mutex#sleep
542
+ 0.00 3.979 0.000 0.000 3.979 1 DpStmMap::TransactionLog#add_listener
543
+ 0.00 0.002 0.000 0.000 0.002 1 ConditionVariable#wait
544
+ 0.00 0.000 0.000 0.000 0.000 1 Array#push
545
+ 0.00 0.000 0.000 0.000 0.000 1 <Class::Thread>#current
546
+
547
+ * indicates recursively called methods
@@ -0,0 +1,78 @@
1
+ require 'dp_stm_map'
2
+ require 'timeout'
3
+ require 'tmpdir'
4
+ require 'fileutils'
5
+ require "xray/thread_dump_signal_handler"
6
+
7
+ module DpStmMap
8
+
9
+
10
+
11
+ describe ClientLocalStore do
12
+
13
+
14
+ before do
15
+ @storage_dir=Dir.mktmpdir
16
+ end
17
+
18
+ after do
19
+ FileUtils.rm_rf(@storage_dir)
20
+ end
21
+
22
+ subject {ClientLocalStore.new @storage_dir}
23
+
24
+ describe :update do
25
+ it "should store new value" do
26
+ subject.update(1,{'abc' => "value"}, {'x' => 'abc'}, [].to_set)
27
+ subject['x'].should == 'value'
28
+ end
29
+ it "should update existing value" do
30
+ subject.update(1,{'abc' => "value"}, {'x' => 'abc'}, [].to_set)
31
+ subject.update(1,{'def' => "changed"}, {'x' => 'def'}, [].to_set)
32
+ subject['x'].should == 'changed'
33
+ end
34
+ it "should raise exception if content is not found" do
35
+ expect{subject.update(1,{}, {'x' => 'dd'}, [].to_set)}.to raise_error StandardError
36
+ end
37
+
38
+ it "should delete values when new hash is nil" do
39
+ subject.update(1,{'abc' => "value"}, {'x' => 'abc'}, [].to_set)
40
+ subject.update(1,{}, {'x' => nil}, ['abc'].to_set)
41
+ subject['x'].should be_nil
42
+ end
43
+
44
+ it "should report changes caused by the update" do
45
+ subject.update(1,{'abc' => "value"}, {'x' => 'abc'}, [].to_set).should == {'x' => [nil,'value']}
46
+ end
47
+
48
+ end
49
+
50
+ describe :has_key? do
51
+ it "should return false when key does not exist" do
52
+ subject.should_not have_key('abc')
53
+ end
54
+ it "should return true when key does exist" do
55
+ subject.update(1,{'abc' => "value"}, {'x' => 'abc'}, [].to_set)
56
+ subject.should have_key('x')
57
+ end
58
+ end
59
+
60
+ describe :[] do
61
+ it "should return nil for not existing value" do
62
+ subject['x'].should be_nil
63
+ end
64
+ end
65
+
66
+
67
+ describe :current_transaction_sequence do
68
+ it "should return 0 for no transactions" do
69
+ subject.current_transaction_sequence.should == 0
70
+ end
71
+ it "should return last transaction sequence for first update" do
72
+ subject.update(1,{'abc' => "value"}, {'x' => 'abc'}, [].to_set)
73
+ subject.current_transaction_sequence.should == 1
74
+ end
75
+ end
76
+
77
+ end
78
+ end