Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
9d7de2fb
Commit
9d7de2fb
authored
Dec 11, 2015
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #716 from fanyeren/patch-15
lxc-top: limit CPU to 8 characters
parents
9bfdc223
51fdb0fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lxc_top.c
src/lxc/lxc_top.c
+3
-3
No files found.
src/lxc/lxc_top.c
View file @
9d7de2fb
...
...
@@ -281,12 +281,12 @@ static void stats_get(struct lxc_container *c, struct ct *ct, struct stats *tota
static
void
stats_print_header
(
struct
stats
*
stats
)
{
printf
(
TERMRVRS
TERMBOLD
);
printf
(
"%-18s %
8s %8s %8
s %10s %10s"
,
"Container"
,
"CPU"
,
"CPU"
,
"CPU"
,
"BlkIO"
,
"Mem"
);
printf
(
"%-18s %
12s %12s %12
s %10s %10s"
,
"Container"
,
"CPU"
,
"CPU"
,
"CPU"
,
"BlkIO"
,
"Mem"
);
if
(
stats
->
kmem_used
>
0
)
printf
(
" %10s"
,
"KMem"
);
printf
(
"
\n
"
);
printf
(
"%-18s %
8s %8s %8
s %10s %10s"
,
"Name"
,
"Used"
,
"Sys"
,
"User"
,
"Total"
,
"Used"
);
printf
(
"%-18s %
12s %12s %12
s %10s %10s"
,
"Name"
,
"Used"
,
"Sys"
,
"User"
,
"Total"
,
"Used"
);
if
(
stats
->
kmem_used
>
0
)
printf
(
" %10s"
,
"Used"
);
printf
(
"
\n
"
);
...
...
@@ -303,7 +303,7 @@ static void stats_print(const char *name, const struct stats *stats,
size_humanize
(
stats
->
blkio
,
blkio_str
,
sizeof
(
blkio_str
));
size_humanize
(
stats
->
mem_used
,
mem_used_str
,
sizeof
(
mem_used_str
));
printf
(
"%-18.18s %
8.2f %8.2f %8
.2f %10s %10s"
,
printf
(
"%-18.18s %
12.2f %12.2f %12
.2f %10s %10s"
,
name
,
(
float
)
stats
->
cpu_use_nanos
/
1000000000
,
(
float
)
stats
->
cpu_use_sys
/
USER_HZ
,
...
...
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