Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
96758992
Commit
96758992
authored
9 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
box.slab.stats(): return a correct tuple, not a multi-return
Make box.slab.stats() output CALL compatible.
parent
bc912acb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/box/lua/slab.cc
+5
-2
5 additions, 2 deletions
src/box/lua/slab.cc
with
5 additions
and
2 deletions
src/box/lua/slab.cc
+
5
−
2
View file @
96758992
...
@@ -63,6 +63,8 @@ small_stats_lua_cb(const struct mempool_stats *stats, void *cb_ctx)
...
@@ -63,6 +63,8 @@ small_stats_lua_cb(const struct mempool_stats *stats, void *cb_ctx)
* Create a Lua table for every slab class. A class is
* Create a Lua table for every slab class. A class is
* defined by its item size.
* defined by its item size.
*/
*/
/** Assign next slab size to the next member of an array. */
lua_pushnumber
(
L
,
lua_objlen
(
L
,
-
1
)
+
1
);
lua_newtable
(
L
);
lua_newtable
(
L
);
/**
/**
* This is in fact only to force YaML flow "compact" for this
* This is in fact only to force YaML flow "compact" for this
...
@@ -94,6 +96,7 @@ small_stats_lua_cb(const struct mempool_stats *stats, void *cb_ctx)
...
@@ -94,6 +96,7 @@ small_stats_lua_cb(const struct mempool_stats *stats, void *cb_ctx)
luaL_pushuint64
(
L
,
stats
->
objcount
);
luaL_pushuint64
(
L
,
stats
->
objcount
);
lua_settable
(
L
,
-
3
);
lua_settable
(
L
,
-
3
);
lua_settable
(
L
,
-
3
);
return
0
;
return
0
;
}
}
...
@@ -103,7 +106,7 @@ static int
...
@@ -103,7 +106,7 @@ static int
lbox_slab_stats
(
struct
lua_State
*
L
)
lbox_slab_stats
(
struct
lua_State
*
L
)
{
{
struct
small_stats
totals
;
struct
small_stats
totals
;
int
top
=
lua_gettop
(
L
);
lua_newtable
(
L
);
/*
/*
* List all slabs used for tuples and slabs used for
* List all slabs used for tuples and slabs used for
* indexes, with their stats.
* indexes, with their stats.
...
@@ -113,7 +116,7 @@ lbox_slab_stats(struct lua_State *L)
...
@@ -113,7 +116,7 @@ lbox_slab_stats(struct lua_State *L)
mempool_stats
(
&
memtx_index_extent_pool
,
&
index_stats
);
mempool_stats
(
&
memtx_index_extent_pool
,
&
index_stats
);
small_stats_lua_cb
(
&
index_stats
,
L
);
small_stats_lua_cb
(
&
index_stats
,
L
);
return
lua_gettop
(
L
)
-
top
;
return
1
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment