RFR: 8223697: jfr tool can't format duration values greater than 1 minute

Yasumasa Suenaga yasuenag at gmail.com
Fri Sep 27 12:43:14 UTC 2019


Hi Chihiro,


  564             } else {
  565                 println(String.format("%d.0", d.toSeconds()) + " s");
  566             }


Is it correct?
According to JBS, it should show "1234.567 s" as the result.
But this code isn't do that.

My confirmation on jshell is below:

---------------
jshell> import java.time.*

jshell> Duration d = Duration.ofMillis(1234567)
d ==> PT20M34.567S

jshell> System.out.println(String.format("%d.0", d.toSeconds()) + " s");
1234.0 s
---------------

Duration::toSeconds returns long value, and string format is incorrect IMHO.


Yasumasa


On 2019/09/27 18:08, Chihiro Ito wrote:
> Hi,
> 
> Can anyone review this?
> 
> JBS https://bugs.openjdk.java.net/browse/JDK-8223697
> webrev http://cr.openjdk.java.net/~cito/JDK-8223697/webrev.00/
> 
> Regards,
> Chihiro
> 
> 
> 2019年9月14日(土) 0:06 Chihiro Ito <chiroito107 at gmail.com <mailto:chiroito107 at gmail.com>>:
> 
>     Hi,
> 
>     Could you review this tiny change, please?
> 
>     http://cr.openjdk.java.net/~cito/JDK-8223697/webrev.00/
> 
>     Regards,
>     Chihiro
> 


More information about the hotspot-jfr-dev mailing list