# -*- coding: windows-1251 -*- # Calculates delays from FIX 35=D,F,G to FIX 35=8 150=0,4,6,5 replies and builds latency probability distribution # uses tshark output with FIX packets dissections # python 2.x and 3.x compatible on Windows and Linux #========================================== from ctypes import * import time import sys import os import socket import random import math import string import re import array #=========================================== def simplecount(filename): lines= 0 for line in open(filename): lines += 1 return lines ord_file_name =sys.argv[1] out_fname=ord_file_name + ".log" stat_fname=ord_file_name + ".stats" out_file=open(out_fname,"w+") stat_file=open(stat_fname,"w+") LCount=simplecount(ord_file_name) ord_file = open(ord_file_name) record= ord_file.readlines() ord_file.close() st=[] b=[] dd=0 ddd=0 bg=20 distr=[] lv=1000 # number of steps in distribution .stats file step=5 # bin size in microseconds while ddd