Menu

#2963 (ok 3.3-alpha2) Seeing "m" as unit is confusing

3.3.0
fixed
None
1
2013-06-11
2010-01-14
No

In server_status, I see this:

show grants 2 0.02 0.00%
show variables 2 0.02 0.00%
show status 1 8.82 m 0.00%
show master status 1 8.82 m 0.00%

What's the m postfix of 8.82? Can't be mega...
Milli? That'd be too confusing.

Discussion

  • Marc Delisle

    Marc Delisle - 2010-01-19

    Yes, according to libraries/common.lib.php in PMA_formatNumber(), this "m" is for milli.

     
  • Marc Delisle

    Marc Delisle - 2010-01-19
    • assigned_to: nobody --> lem9
     
  • Olaf van der Spek

    That's too confusing...
    Is there a need for milli anywhere?

     
  • Marc Delisle

    Marc Delisle - 2010-01-19

    Which value do you want to see there, instead of 8.82m ?

     
  • Olaf van der Spek

    0.0082 or 0.00
    Maybe even 8.82 milli

     
  • Marc Delisle

    Marc Delisle - 2010-01-19

    Well, lowercase m is the standard ISO for milli. This patch would produce more decimals, but for an average per hour I think it's overkill to display so many decimals.

    Index: server_status.php

    --- server_status.php (revision 13258)
    +++ server_status.php (copie de travail)
    @@ -570,7 +570,7 @@
    <th class="name"><?php echo htmlspecialchars($name); ?></th>
    <td class="value"><?php echo PMA_formatNumber($value, 4, 0); ?></td>
    <td class="value"><?php echo
    - PMA_formatNumber($value * $hour_factor, 4, 2); ?></td>
    + PMA_formatNumber($value * $hour_factor, 4, 4); ?></td>
    <td class="value"><?php echo
    PMA_formatNumber($value * $perc_factor, 0, 2); ?>%</td>
    </tr>

     
  • Olaf van der Spek

    Yes, but this is an app, not science...
    So m is just too confusing.

    3 significant digits is good, 4 digits after the dot should not be done.

    It'd be nice to show 1,692.83 as 1.69 k actually.

     
  • Marc Delisle

    Marc Delisle - 2010-01-19

    Without the patch, in my server status, I see in the average for SELECT: 21.27 k so I wonder why you are asking to see 1.69 k. Are you talking about the hourly average?

     
  • Olaf van der Spek

    Yes. The request is to have 3 (and only 3) significant digits. A function I've written:
    function xbt_b2a($v)
    {
    for ($l = 0; $v < -999 || $v > 999; $l++)
    $v /= 1024;
    $a = array('b', 'kb', 'mb', 'gb', 'tb', 'pb', 'eb', 'zb', 'eb');
    return sprintf('%.2f %s', $v, $a[$l]);
    }

     
  • Marc Delisle

    Marc Delisle - 2010-01-19

    This patch should do the job, please confirm:
    Index: server_status.php
    ===================================================================
    --- server_status.php (revision 13258)
    +++ server_status.php (copie de travail)
    @@ -570,7 +570,7 @@
    <th class="name"><?php echo htmlspecialchars($name); ?></th>
    <td class="value"><?php echo PMA_formatNumber($value, 4, 0); ?></td>
    <td class="value"><?php echo
    - PMA_formatNumber($value * $hour_factor, 4, 2); ?></td>
    + PMA_formatNumber($value * $hour_factor, 3, 3); ?></td>
    <td class="value"><?php echo
    PMA_formatNumber($value * $perc_factor, 0, 2); ?>%</td>
    </tr>

     
  • Olaf van der Spek

    Isn't that 3 digits before and 3 after the dot?
    That's not what 3 significant digits means. 3 digits would be:
    #.##
    ##.#
    ###
    #.## k
    ##.# k
    ### k
    etc

     
  • Marc Delisle

    Marc Delisle - 2010-01-19

    Please try it.

     
  • Olaf van der Spek

    It does fix the issue with milli, but the other issues are still present.

     
  • Marc Delisle

    Marc Delisle - 2010-01-19

    I was not aware that there were other issues mentioned in this tracker item. Are you talking about the feature request you cited?

     
  • Olaf van der Spek

    Oops. Yes. ;)

     
  • Marc Delisle

    Marc Delisle - 2010-01-19
    • summary: Wrong unit --> Seeing "m" as unit is confusing
     
  • Marc Delisle

    Marc Delisle - 2010-01-19
    • priority: 5 --> 1
    • summary: Seeing "m" as unit is confusing --> (ok 3.3-alpha2) Seeing "m" as unit is confusing
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2010-01-19

    Fixed in subversion, thanks for reporting.

     
  • Marc Delisle

    Marc Delisle - 2010-03-08
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed