X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=nfs3%2Fparse-synread.py;h=1f07ca20b3a5ba3929d0af44ac836cf81ec9b0d7;hb=8ff0fd08d6e1cc97cdb7e94b7cd97dc28c29e674;hp=91f128b3a29dea240c64eb88dc705af8701dabc7;hpb=b54d93195121656087794dfd748768cdfd180aed;p=bluesky.git diff --git a/nfs3/parse-synread.py b/nfs3/parse-synread.py index 91f128b..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 @@ -15,20 +42,22 @@ def load_log(f): return data if __name__ == '__main__': + blocksize = int(sys.argv[1]) data = [] - for f in sys.argv[1:]: + for f in sys.argv[2:]: data += load_log(open(f)) 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:", len(truncated) / duration * 1048576 - print "Average latency:", sum(d[1] for d in truncated) / len(truncated) + #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)