@@ -249,34 +249,6 @@ function stats.get(space_name)
249
249
return internal :get_registry ().get (space_name )
250
250
end
251
251
252
- local function resolve_space_name (space_id )
253
- -- Resolving name with custom vshard router is not supported.
254
- local vshard_router = vshard .router .static
255
-
256
- if vshard_router == nil then
257
- log .warn (' Failed to resolve space name for stats: default vshard router not found' )
258
- return nil
259
- end
260
-
261
- local replicasets = vshard_router :routeall ()
262
- if next (replicasets ) == nil then
263
- log .warn (' Failed to resolve space name for stats: no replicasets found with default router' )
264
- return nil
265
- end
266
-
267
- local space , err = utils .get_space (space_id , vshard_router )
268
- if err ~= nil then
269
- log .warn (" An error occurred during getting space: %s" , err )
270
- return nil
271
- end
272
- if space == nil then
273
- log .warn (' Failed to resolve space name for stats: no space found for id %d with default router' , space_id )
274
- return nil
275
- end
276
-
277
- return space .name
278
- end
279
-
280
252
-- Hack to set __gc for a table in Lua 5.1
281
253
-- See https://stackoverflow.com/questions/27426704/lua-5-1-workaround-for-gc-metamethod-for-tables
282
254
-- or https://habr.com/ru/post/346892/
@@ -351,26 +323,13 @@ local function wrap_pairs_gen(build_latency, space_name, op, gen, param, state)
351
323
end
352
324
353
325
local function wrap_tail (space_name , op , pairs , start_time , call_status , ...)
354
- dev_checks (' string|number ' , ' string' , ' boolean' , ' number' , ' boolean' )
326
+ dev_checks (' string' , ' string' , ' boolean' , ' number' , ' boolean' )
355
327
356
328
local finish_time = clock .monotonic ()
357
329
local latency = finish_time - start_time
358
330
359
331
local registry = internal :get_registry ()
360
332
361
- -- If space id is provided instead of name, try to resolve name.
362
- -- If resolve have failed, use id as string to observe space.
363
- -- If using space id will be deprecated, remove this code as well,
364
- -- see https://github.com/tarantool/crud/issues/255
365
- if type (space_name ) ~= ' string' then
366
- local name = resolve_space_name (space_name )
367
- if name ~= nil then
368
- space_name = name
369
- else
370
- space_name = tostring (space_name )
371
- end
372
- end
373
-
374
333
if call_status == false then
375
334
registry .observe (latency , space_name , op , ' error' )
376
335
error ((... ), 2 )
0 commit comments