Bug 364901 - system monitor should convert minutes to hours at 60 ala prstat and taskmgr
system monitor should convert minutes to hours at 60 ala prstat and taskmgr
Status: RESOLVED FIXED
Product: system-monitor
Classification: Core
Component: process list
2.14.x
Other All
: Normal enhancement
: GNOME 2.18
Assigned To: System-monitor maintainers
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2006-10-25 06:08 UTC by timeless
Modified: 2006-11-01 14:09 UTC (History)
1 user (show)

See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments

Description timeless 2006-10-25 06:08:52 UTC
gnome-system-monitor 2.14.1 with a fairly small font on a large lcd.

in the processes view, i see:
Process Name # Status  # Resident Memory # CPU Time  # Nice # ID    # Arguments
genxref      # Running # 1.1 GiB         # 385:39.02 # 16   # 29252 # /usr/bin/perl /export/home/www/html/genxref /export/home/svn/lxr-root/lxr-data/

being used to (windows)taskmgr and (solaris)prstat, i expected to see output in the form: HH:MM:SS for my long process. I'm also vaguely familiar with top style (MMMM:SS). Instead I got something MMM:SS.cc where cc is fractional seconds The cutoff imo sould be 60minutes.

result: i immediately assumed that system-monitor was buggy because it looked like it said my process had been running for 15 days.

for comparison (numbers are not from the same precise instant...):

swift% uptime
  8:34am  up 5 day(s),  2:10,  3 users,  load average: 1.31, 1.37, 1.39
swift% prstat -p 29252
   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP
 29252 timeless 1080M 1078M cpu2     0   16   6:26:46  24% genxref/1
Total: 1 processes, 1 lwps, load averages: 1.35, 1.38, 1.39
Comment 1 Benoît Dejean 2006-10-25 20:23:57 UTC
OK, i'll stole GNU top code in order to do it :) So it will look like GNU top. Fine ?
Comment 2 timeless 2006-10-26 09:31:16 UTC
gnu top output is not ideal:

 1973 timeless  14   0  1108 1032  724 R 10.5  0.2   2045:08 top

it does at least omit centi-secs, but i'd much prefer that minutes be converted to hours

instead of:
385:39.02
show:
6:25:39 [dropping the .02]
Comment 3 Benoît Dejean 2006-10-26 12:07:15 UTC
	if (weeks)
		/* xgettext: weeks, days */
		return g_strdup_printf(_("%uw%ud"), weeks, days);

"3w1d"

	if (days)
		/* xgettext: days, hours (0 -> 23) */
		return g_strdup_printf(_("%ud%02uh"), days, hours);

"4d07h"


	if (hours) 
		/* xgettext: hours (0 -> 23), minutes, seconds */
		return g_strdup_printf(_("%u:%02u:%02u"), hours, minutes, seconds);


"5:01:03"

	/* xgettext: minutes, seconds, centiseconds */
	return g_strdup_printf(_("%u:%02u.%02u"), minutes, seconds, centiseconds);

"42:01.66"


Likes this ?

Comment 4 timeless 2006-10-27 10:11:33 UTC
that sounds great :)
Comment 5 Benoît Dejean 2006-11-01 14:09:42 UTC
OK, i've commited this new formatting. It would be nice if you could try it :) Thanks.

Fixed in the development version. The fix will be available in the next major release. Thank you for your bug report.

Note You need to log in before you can comment on or make changes to this bug.