Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Erwan Velu <erwan@enovance.com>
To: fio@vger.kernel.org
Subject: [Pull Request] Fixing coherency in fio2gnuplot
Date: Mon, 22 Jul 2013 19:46:36 +0200	[thread overview]
Message-ID: <51ED6FFC.2070309@enovance.com> (raw)

Hello,
Sorry to make many pull request in a row but I just discover a serious 
problem when plotting multiple traces at the same time. It was in fact 
shortening the plots & rendering to the smallest trace file.

This bug is pretty boring and this patch series does fix it.
The branch is on top the current master, shall be easy to merge ;o)

Thanks,
Erwan

--------

The following changes since commit 21356fee2727b71ef72b39414955c5e7e98f97c1:

   net: Add UDP multicast example job file (2013-07-22 09:04:38 -0600)

are available in the git repository at:

   git@github.com:enovance/fio.git fix_coherency

for you to fetch changes up to d7e30e61f2c1d9c6101cc6896009750aae2e2bcf:

   fio2gnuplot: Don't plot fake data (2013-07-22 19:39:24 +0200)

----------------------------------------------------------------
Erwan Velu (3):
       fio2gnuplot: Keep original filename in temp. files
       fio2gnuplot: Don't truncate fio log files
       fio2gnuplot: Don't plot fake data

  tools/plot/fio2gnuplot.py | 20 ++++++++++++++++----
  1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/tools/plot/fio2gnuplot.py b/tools/plot/fio2gnuplot.py
index ef32ee0..03ef0dd 100755
--- a/tools/plot/fio2gnuplot.py
+++ b/tools/plot/fio2gnuplot.py
@@ -91,17 +91,26 @@ def compute_temp_file(fio_data_file,disk_perf):
          files.append(open(file))
          pos = len(files) - 1
          tmp_filename = "gnuplot_temp_file.%d" % pos
-        temp_outfile.append(open(tmp_filename,'w'))
+        gnuplot_file=open(tmp_filename,'w')
+        temp_outfile.append(gnuplot_file)
+        gnuplot_file.write("#Temporary file based on file %s\n" % file)
          disk_perf.append([])

      shall_break = False
      while True:
          current_line=[]
+        nb_empty_files=0
+        nb_files=len(files)
          for file in files:
              s=file.readline().replace(',',' ').split()
              if not s:
+                nb_empty_files+=1
+                s="-1, 0, 0, 0'".replace(',',' ').split()
+
+            if (nb_empty_files == nb_files):
                  shall_break=True
                  break;
+
              current_line.append(s);

          if shall_break == True:
@@ -117,14 +126,17 @@ def compute_temp_file(fio_data_file,disk_perf):

              # We ignore the first 500msec as it doesn't seems to be 
part of the real benchmark
              # Time < 500 usually reports BW=0 breaking the min computing
-            if ((int(time)) > 500):
+            if (((int(time)) > 500) or (int(time)==-1)):
                  disk_perf[index].append(int(perf))
-                perfs.append(perf)
+                perfs.append("%s %s"% (time, perf))
                  index = index + 1

          # If we reach this point, it means that all the traces are 
coherent
          for p in enumerate(perfs):
-            temp_outfile[p[0]].write("%s %.2f %s\n" % (p[0], 
float(float(time)/1000), p[1]))
+            perf_time,perf = p[1].split()
+            if (perf_time != "-1"):
+                temp_outfile[p[0]].write("%s %.2f %s\n" % (p[0], 
float(float(perf_time)/1000), perf))
+

      for file in files:
          file.close()


             reply	other threads:[~2013-07-22 17:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22 17:46 Erwan Velu [this message]
2013-07-22 18:29 ` [Pull Request] Fixing coherency in fio2gnuplot Jens Axboe
2013-07-22 20:52   ` Erwan Velu
2013-07-22 20:58     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51ED6FFC.2070309@enovance.com \
    --to=erwan@enovance.com \
    --cc=fio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox