%owninteger end = -1 %ownintegerarray time(0:1100) = 0(1101) %ownintegerarray kbs(0:1100) = 0(1101) %ownintegerarray cpu(0:1100) = 0(1101) %ownintegerarray users(0:1100) = 0(1101) %ownintegerarray rjeo(0:1100) = 0(1101) %ownintegerarray pkts(0:1100) = 0(1101) %ownintegerarray sbr(0:1100) = 0(1101) %ownintegerarray itp(0:1100) = 0(1101) %ownintegerarray rjei(0:1100) = 0(1101) %owninteger length, arraddr %ownreal timei = 1, max1, max2, slope1, slope2 %externalintegerfnspec smaddr(%integer chan, %integername len) %externalroutinespec destroy(%string (255) s) %externalroutinespec newsmfile(%string (255) s) %routinespec graph1(%realarrayname results) %routinespec graph4(%realarrayname results) %routinespec graph5(%realarrayname results) %routinespec graph6(%realarrayname results) %externalroutinespec define(%string (255) s) %externalroutinespec close stream(%integer cham) %recordformat ff( %c %integer tim, users,sta,cpu,pkts,sbr,byt,rjeo,rjei,itp) %recordformat resf(%realarray results(0:23)) %recordformat filef(%string (255) title, %integer end) ! %record (ff) %array r(0:8, 0:1100)) %externalroutine mon convert(%string (255) s) %string (255) t, u, uu, title, uuu %record (ff) %array %name ra %record (ff) %array %format raf(0:8, 0:1100) %ownrecord (ff) %array oldf(0:8) %record (ff) %name o %integer i, diff, k, l, us, cp, kb, pk, rj, who, who1, who2, xxx %owninteger usersx, sta, pktsx, sbrx, byt, rjeo, tim, rjeix %owninteger points, fep no = -1, flag = -1 %constintegerarray cpu f(0:8) = %c 252(3), 220, 550(2), 500, 500, 500 %record (ff) f %record (ff) %name fn %record (filef) %name fi !! !! !! %routine rd(%integername n) read(n) %if n< 0 %then n = n+32768*2 %end !! !! %routine do reply %integer k %integerfn calc(%integer new, %integername old, %integer x) %integer n, p, k %if old>new %then old = old-32768*2 n = new-old %if n < 0 %then n = -n n = n//diff; p = n %if x = -1 %start p =100-((n*100)//cpu f(who)) %finishelsestart %if x = -2 %start; ! bytes n = n+2*pk; ! allow for rounding (see sbr) %finishelsestart p = n*x %finish %finish old = new %result = p %end !! ! diff = f_tim-tim ! diff = 1 %if diff<=0 diff = 1 %if who <= 5 %start; ! fep tim = f_tim sta = f_sta xxx = o_cpu cp = calc(f_cpu, o_cpu, -1) i = calc(f_pkts, o_pkts, 1) pk = i k = calc(f_rjeo, o_rjeo, 1) l = calc(f_sbr, o_sbr, 1) rj = calc(f_rjei, o_rjei, 1) kb = calc(f_byt, o_byt, -2) %if cp < 0 %or cp > 100 %start write(who, 2) printstring(" cpu ="); write(cp, 1) write(f_cpu-xxx, 1) write(f_cpu, 1) write(xxx, 1); newline %finishelsestart fn_byt = (kb*16)//750 %if cp<0 %or cp>100 %then cp=0 %if f_users<0 %then f_users = 0 fn_cpu = cp; fn_users = f_users fn_pkts = i; fn_rjeo = k fn_sbr = l; fn_itp = i-k-l %if rj > 2000 %then rj=0 fn_rjei = rj %finish %finishelsestart; ! nodes %finish points = points+1 %end flag = -1 %unless s -> t.("/").uuu %start printstring("params ??? ") %return %finish define("1,".t) define("2,".uuu) select input(1) destroy(uuu) newsmfile(uuu.",400000") length = 100000 arraddr = smaddr(2, length) fi == record(arraddr) ra == array(arraddr+300, raf) title = "" %cycle readsymbol(i) %exit %if i = nl title = title.tostring(i) %repeat %cycle fi_title = title rd(who) %exit %if who>32000 %unless 0<=who<=8 %start printstring("format failure, machine no =") write(who, 1); newline %return %finish end = end+1 %if who = 0 flag = 1 fn == ra(who, end) o == oldf(who); ! pick up last entries for this one rd(f_tim) %exit %if end = 1100 f_tim = f_tim//6 rd(f_users); rd(f_sta) %if f_users>32766 %then f_users = -1 rd(f_cpu); rd(f_pkts); rd(f_sbr) rd(f_byt) %if who <= 5 %start rd(f_rjeo) rd(f_rjei) %finishelsestart f_rjeo=0; f_rjei = 0 %finish do reply %repeat select output(0); select input(0); close stream(1) %if flag >= 0 %and end = -1 %start printstring("inconsistency ******************** ") %stop %finish fi_end = end %end %externalroutine fepfig(%string (255) s) %ownstring (3) nn = "0" %conststring (7) %array names(0:5) = %c "2980(0)", "2980(1)", "2980(2)", "2972(4)", "2972(1)", "2972(2)" %record (filef) %name fi %ownstring (19) %array titlex(1:23) = %c "Max users ", "Least Users ", "Average Users ", "Max Cpu Used ", "Average Cpu ", "%Cpu/ten users ", "Variation +/- ", "Max Capacity ", "Variation +/- ", "ITP Pkts/Min/User ", "Standard Deviation ", "SBR Pkts/Min/User ", "Standard Deviation ", "Maximum Pkts ", "Average No of Pkts ", "Pkts at 100% Cpu ", "Variation +/- ", "Pkts with correct. ", "Variation +/- ", "Max RJE-o pkts ", "Average RJE-o ", "Max RJE-i Pkts ", "Average RJE-i " %record (ff) %array %name ra %record (ff) %array %format raf(0:8, 0:1100) %ownrecord (ff) %array oldf(0:8) %record (ff) %name o %integer i, j, k, x, fepno %record (resf) %array resa(0:8) define("2,".s) length = 100000 arraddr = smaddr(2, length) fi == record(arraddr) ra == array(arraddr+300, raf) end = fi_end %if end <= 0 %start printstring("Run mon convert first ") %stop %finish %cycle i = 0, 1, 8 %cycle j = 1, 1, 23 resa(i)_results(j) = 0 %repeat %repeat %cycle i = 0, 1, end users(i) = ra(0, 1)_users+ra(1, i)_users+ra(2, i)_users cpu(i) = (ra(0, i)_cpu+ra(1,i)_cpu+ra(2,i)_cpu)//3 itp(I) = ra(0,i)_itp+ra(1,i)_itp+ra(2,i)_itp sbr(I) = ra(0,i)_sbr+ra(1,i)_sbr+ra(2,i)_sbr rjei(i) = ra(0,i)_rjei+ra(1,i)_rjei+ra(2,i)_rjei pkts(i) = ra(0,i)_pkts+ra(1,i)_pkts+ra(2,i)_pkts rjeo(i) = ra(0,i)_rjeo+ra(1,i)_rjeo+ra(2,i)_rjeo %repeat graph1(resa(1)_results) graph4(resa(1)_results) graph5(resa(1)_results) graph6(resa(1)_results) %cycle i = 0, 1, end users(i) = ra(4,i)_users+ra(5,i)_users cpu(i) = (ra(4,i)_cpu+ra(5,i)_cpu)//2 itp(i) = ra(4,i)_itp+ra(5,i)_itp sbr(i) = ra(4,i)_sbr+ra(5,i)_sbr rjei(i) = ra(4, i)_rjei+ra(5,i)_rjei rjeo(i) = ra(4, i)_rjeo+ra(5, i)_rjeo pkts(i) = ra(4, i)_pkts+ra(5, i)_pkts %repeat graph1(resa(2)_results) graph4(resa(2)_results) graph5(resa(2)_results) graph6(resa(2)_results) %cycle fepno = 0, 1, 5 %cycle i = 0, 1, end users(i) = ra(fepno, i)_users cpu(i) = ra(fepno, i)_cpu itp(i) = ra(fepno, i)_itp sbr(i) = ra(fepno, i)_sbr rjei(i) = ra(fepno, i)_rjei rjeo(i) = ra(fepno, i)_rjeo pkts(i) = ra(fepno, i)_pkts %repeat graph1(resa(3+fepno)_results) graph4(resa(3+fepno)_results) graph5(resa(3+fepno)_results) graph6(resa(3+fepno)_results) %repeat newpage spaces(40); printstring("Title:") printstring(fi_title); newlines(5) printstring(" All 2980 Feps All 2972 Feps ") %cycle i = 0, 1, 5 printstring(names(I)); spaces(6) %repeat newline %cycle i = 1, 1, 23 printstring(titlex(i)) %cycle j = 1, 1, 8; ! feps print(resa(j)_results(i), 12, 0) %repeat newline newline %if i=3 %or i=9 %or i=13 %or i=19 %repeat newpage; newline %end ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! 2900 fep statistics package ! ! ! ! graph1 - users v kilo bytes/second and cpu ! ! graph2 - 2900 users v blocks rxd & txd ! ! graph3 - 2970 users v blocks rxd & txd ! ! graph4 - frequency v pkts/min/user ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! %routine regression(%integerarrayname x,y, %c %integer end, %longrealname a0,b0,a1,b1) %integer i %longreal sx,sy,sx2,sxy,sy2 sx=0;sy=0;sx2=0;sxy=0;sy2=0 %cycle i = 1, 1, end sx = sx+x(i); sy = sy+y(i) sx2 = sx2 + x(i)*x(i); sy2 = sy2+y(i)*y(i) sxy = sxy+x(i)*y(i) %repeat %return %if sx=0 %or sy=0 b0 = ((sy*sx2)-(sx*sxy))/((end*sx2-sx*sx)) b1 = ((sx*sy2)-(sy*sxy))/(end*sy2-sy*sy) a0 = (end*sxy-sx*sy)/(end*sx2-sx*sx) a1 = (end*sxy-sx*sy)/(end*sy2-sy*sy) %end ! %routine draw regression lines(%integerarrayname x, y, %c %integer end, %longreal minx,maxx,miny,maxy) %ownlongreal a0=0,a1=0,b0=0,b1=0 %longrealarray nos,avs(0:1) regression(x,y,end,a0,b0,a1,b1) nos(0) = 0; nos(1) = maxx avs(0) = b0; avs(1) = maxx*a0+b0 max1 = avs(1); slope1 = avs(1)/maxx %if b0<0 %start %return %if a0=0 avs(0) = 0; nos(0) = -b0/a0 %finish %if avs(1) > maxy %start %return %if a0=0 avs(1) = maxy; nos(1) = maxy/a0-b0/a0 %finish nos(0) = 0; nos(1) = maxx %return %if a1=0 avs(0) = -b1/a1; avs(1) = maxx/a1-b1/a1 max2 = avs(1); slope2 = avs(1)/maxx %if avs(0) < 0 %start avs(0) = 0; nos(0) = b1 %finish %if avs(1)>maxy %start avs(1) = maxy nos(1) = maxy*a1+b1 %finish %end ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! 2900 fep statistics graph 1 routine ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! this analyses the data from the #pre file and produces a ! graph of time v. total users,nibbles and cpu rate. ! the file is listed automatically to .gp ! ! %routine graph1(%realarrayname results) %string(63) file,title %integer i,k, usn, usa, cpm, cpa, lus ! ! ! usn = 0; usa = 0; cpm = 0; cpa = 0; lus = 9999 %cycle i=0,1,end k=users(i) %if k > usn %then usn = k %if k < lus %then lus = k usa = usa+k k = cpu(i) %if k>cpm %then cpm = k cpa = cpa+k %repeat draw regression lines(users, cpu,end,0,120,0,100) results(1) = usn results(2) = lus results(3) = usa/(end+1) results(4) = cpm results(5) = cpa/(end+1) %if usn > 0 %start results(6) = 10*(1/slope1+1/slope2)/2 results(7) = 10*(1/slope1-1/slope2)/2 results(8) = 100*(slope1+slope2)/2 results(9) = 100*(slope1-slope2)/2 %finish %end ! ! ! %routine graph4(%realarrayname results) %string(63) file,title %real raver,taver,rdeviation,tdeviation %ownintegerarray rfreq(0:50) %ownintegerarray tfreq(0:50) %ownintegerarray tkeep(1:1100) %ownintegerarray rkeep(1:1100) %longinteger rcount,tcount %integer co %constinteger maxhost=2 %integer host,i ! ! ! %routine read records %integer i,j,user,tx,rx co=0; tcount=0; rcount=0 %cycle i = 0, 1, end user = users(i) tx = sbr(i); rx = itp(i) %if user<=0 %then %continue co = co+1 j=tx//user %if j<0 %then j = 0 %if j>=500 %start printstring("tx bounds"); write(j,2); newline j = 500 %finish tfreq(j//10)=tfreq(j//10)+1 tcount=tcount+j tkeep(co)=j j=rx//user %if j<0 %then j=0 %if j>=500 %start printstring("rx bounds"); write(j,2); newline j = 500 %finish rfreq(j//10)=rfreq(j//10)+1 rcount=rcount+j rkeep(co)=j %repeat %if co=0 %then co=1 raver=rcount/co taver=tcount/co %end ! %routine compute deviation %integer i,rj,tj %real rtot,ttot rtot=0; ttot=0 %cycle i=1,1,co rtot=rtot+((raver-rkeep(i))**2) ttot=ttot+((taver-tkeep(i))**2) %repeat rdeviation=sqrt(rtot/co) tdeviation=sqrt(ttot/co) %end ! ! code starts here ! read records compute deviation ! ! results(10) = raver; results(11) = rdeviation results(12) = taver; results(13) = tdeviation %end ! ! %routine graph5(%realarrayname results) %longrealarray nos,avs(0:100) %integer i,k ! %routine zap %integer i %cycle i=0,1,100 avs(i)=0; nos(i)=0 %repeat %end ! %routine avg %integer i %integerarray tt(0:100) %cycle i=0,1,100 tt(i) = i %if nos(i)>0 %then avs(i)=avs(i)/nos(i) %repeat %end ! ! code starts here ! draw regression lines(cpu,pkts,end,0,100,0,2000) results(16) = (max1+max2)/2 results(17) = (max1-max2)/2 ! ! %cycle i=0,1,end itp(i) = pkts(i)+rjei(i) k=cpu(i) %repeat draw regression lines(cpu, itp, end,0,100,0,2000) results(18) = (max1+max2)/2 results(19) = (max1-max2)/2 %end ! %routine graph6(%realarrayname results) %integer i, j, k, ri, rim, rit, ro, rom, rot, r, rm, rt ri=0; rim=0; rit=0; ro=0;rom=0;rot=0; rm=0; r=0; rt = 0 %cycle i = 0, 1, end ri = rjei(i); ro = rjeo(i); r = pkts(i) %if ri>rim %then rim=ri %if ro>rom %then rom=ro %if r>rm %then rm = r rit = rit+ri; rot = rot+ro; rt = rt+r %repeat results(14) = rm; results(15) = rt/(end+1) results(20) = rom; results(21) = rot/(end+1) results(22) = rim; results(22) = rit/(end+1) %end %endoffile