Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
438be389
Commit
438be389
authored
Jul 31, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FT-300 Print terse results when verbose = false
parent
1d6a67e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
5 deletions
+28
-5
tools/ba_replay.cc
tools/ba_replay.cc
+28
-5
No files found.
tools/ba_replay.cc
View file @
438be389
...
...
@@ -111,6 +111,7 @@ using std::set;
using
std
::
string
;
using
std
::
vector
;
static
bool
debug
=
false
;
static
bool
verbose
=
false
;
static
void
ba_replay_assert
(
bool
pred
,
const
char
*
msg
,
const
char
*
line
,
int
line_num
)
{
...
...
@@ -336,7 +337,7 @@ static void replay_canonicalized_trace(const vector<string> &canonicalized_trace
char
*
line
=
toku_strdup
(
it
->
c_str
());
line
=
strip_newline
(
line
,
nullptr
);
if
(
verbose
)
{
if
(
debug
)
{
printf
(
"playing canonical trace line #%d: %s"
,
line_num
,
line
);
}
...
...
@@ -434,14 +435,13 @@ static const char *strategy_str(block_allocator::allocation_strategy strategy) {
}
}
static
void
print_result
(
uint64_t
allocator_id
,
block_allocator
::
allocation_strategy
strategy
,
TOKU_DB_FRAGMENTATION
report
)
{
static
void
print_result
_verbose
(
uint64_t
allocator_id
,
block_allocator
::
allocation_strategy
strategy
,
TOKU_DB_FRAGMENTATION
report
)
{
uint64_t
total_bytes
=
report
->
data_bytes
+
report
->
unused_bytes
;
uint64_t
total_blocks
=
report
->
data_blocks
+
report
->
unused_blocks
;
if
(
total_bytes
<
32UL
*
1024
*
1024
)
{
printf
(
" ...skipping allocator_id %"
PRId64
" (total bytes < 32mb)
\n
"
,
allocator_id
);
printf
(
"
\n
"
);
return
;
}
...
...
@@ -467,6 +467,26 @@ static void print_result(uint64_t allocator_id,
printf
(
"
\n
"
);
}
static
void
print_result
(
uint64_t
allocator_id
,
block_allocator
::
allocation_strategy
strategy
,
TOKU_DB_FRAGMENTATION
report
)
{
uint64_t
total_bytes
=
report
->
data_bytes
+
report
->
unused_bytes
;
if
(
total_bytes
<
32UL
*
1024
*
1024
)
{
if
(
verbose
)
{
printf
(
" ...skipping allocator_id %"
PRId64
" (total bytes < 32mb)
\n
"
,
allocator_id
);
printf
(
"
\n
"
);
}
return
;
}
if
(
verbose
)
{
print_result_verbose
(
allocator_id
,
strategy
,
report
);
}
else
{
printf
(
" %-15s: allocator %"
PRId64
", %.3lf used bytes
\n
"
,
strategy_str
(
strategy
),
allocator_id
,
static_cast
<
double
>
(
report
->
data_bytes
)
/
total_bytes
);
}
}
static
void
merge_fragmentation_reports
(
TOKU_DB_FRAGMENTATION
dst
,
TOKU_DB_FRAGMENTATION
src
)
{
dst
->
file_size_bytes
+=
src
->
file_size_bytes
;
...
...
@@ -523,8 +543,10 @@ int main(void) {
print_result
(
al
->
first
,
strategy
,
&
report
);
}
reports_by_strategy
[
strategy
]
=
aggregate_report
;
printf
(
"
\n
"
);
}
printf
(
"
\n
"
);
printf
(
"Aggregate reports, by strategy:
\n
"
);
printf
(
"
\n
"
);
...
...
@@ -534,6 +556,7 @@ int main(void) {
print_result
(
0
,
it
->
first
,
report
);
}
printf
(
"
\n
"
);
printf
(
"Overall trace stats:
\n
"
);
printf
(
"
\n
"
);
printf
(
" n_lines_played: %9"
PRIu64
"
\n
"
,
stats
.
n_lines_replayed
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment