From: Pierre-Marc Fournier Date: Thu, 20 May 2010 17:10:07 +0000 (-0400) Subject: add average script X-Git-Tag: v1.9.1~600 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a4e826d7ad30a0a6d68c04e585a51849d4aa6509;p=lttng-ust.git add average script --- diff --git a/tests/benchmark/average b/tests/benchmark/average new file mode 100755 index 00000000..bda898c6 --- /dev/null +++ b/tests/benchmark/average @@ -0,0 +1,18 @@ +#!/usr/bin/python + +import sys + +def main(): + total = 0.0 + n = 0.0 + while 1: + line = sys.stdin.readline() + if not line: + break + + val = float(line) + n = n+1.0 + total = total+val + + print total/n +main()