简体   繁体   中英

Jmeter: format statistics data to have comma in HTML report

Is there a way to transform the statistics data to have comma (,) instead of dot (.) in the generated HTML report.

Like for the data in the attached image.

来自Jmeter的统计数据

This is not something you can customize via JMeter Properties , you will have to do some JavaScript programming (not very complex thought)

  1. Locate dashboard.js.fmkr file under report-template\content\js folder (lives in "bin" folder of your JMeter installation)

  2. You will need to change 2 lines, as of JMeter 5.4.1 they are:

    • Line # 194 which looks like: item = item.toFixed(2) + '%'; , you need to change it to:

       item = item.toFixed(2).toString().replace('.', ',') + '%';
    • Line # 213 which looks like: item = item.toFixed(2); , similarly change it to:

       item = item.toFixed(2).toString().replace('.', ',')

Regenerate the dashboard and you should see the commas instead of dots.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM