X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=nfs3%2Fparse-synread.py;h=1f07ca20b3a5ba3929d0af44ac836cf81ec9b0d7;hb=8ff0fd08d6e1cc97cdb7e94b7cd97dc28c29e674;hp=689ae56c051d774ffba8f1fd58a8a332d06b8668;hpb=0623ad8d40d5459b6168b23bd2c7444913b365fd;p=bluesky.git diff --git a/nfs3/parse-synread.py b/nfs3/parse-synread.py index 689ae56..1f07ca2 100755 --- a/nfs3/parse-synread.py +++ b/nfs3/parse-synread.py @@ -1,4 +1,31 @@ #!/usr/bin/python +# +# Copyright (C) 2011 The Regents of the University of California +# Written by Michael Vrable +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. import struct, sys @@ -22,14 +49,15 @@ if __name__ == '__main__': data.sort() duration = data[-1][0] - data[0][0] - print "Time span: %d to %d (%d seconds)" % (data[0][0], data[-1][0], duration) + #print "Time span: %d to %d (%d seconds)" % (data[0][0], data[-1][0], duration) start = data[0][0] + 5 end = data[-1][0] - 5 truncated = [d for d in data if start <= d[0] <= end] - print len(data), len(truncated) + #print len(data), len(truncated) duration = float(end - start + 1) - print duration - print "Ops per second:", len(truncated) / duration - print "Bandwidth (MB/s):", len(truncated) / duration * blocksize / 1024.0**2 - print "Average latency (ms):", sum(d[1] for d in truncated) / len(truncated) / 1000 + #print duration + #print "# ops/sec\tbandwidth (MB/s)\tLatency(ms)" + print "%s\t%s\t%s" % (len(truncated) / duration, + len(truncated) / duration * blocksize / 1024.0**2, + sum(d[1] for d in truncated) / len(truncated) / 1000)