示例#1
0
#!/usr/bin/python

# Parses metrics.git/out/dirarch/platforms.csv and estimates logistic
# distribution parameters based on this data.

import time
import logistic

f = open("platforms.csv", "r")
f.readline()

upgrade_table = {}
t0 = 0
for l in f.readlines():
  v = l.split(",")
  if v[5] == "NA" or int(v[5]) == 0: continue
  up = (float(v[5])+float(v[6])+float(v[7]))/float(v[8])
  t = time.mktime(time.strptime(v[0], "%Y-%m-%d"))
  if t0 == 0: t0 = t
  upgrade_table[t-t0] = up


(u,s) = logistic.estimate(upgrade_table)

print "s="+str(s)+", u="+str(u)
print "Estimate 50% upgrade at: "+time.ctime(t0+u)
示例#2
0
    nsreqs = total_countries(l)
    l = f.readline()
    while l and not l.startswith("ns-v2-ips"): l = f.readline()
    v2reqs = total_countries(l)
    l = f.readline()
    while l and not l.startswith("n-ns-reqs"): l = f.readline()
    nsips = total_countries(l)
    l = f.readline()
    while l and not l.startswith("n-v2-ns-reqs"): l = f.readline()
    v2ips = total_countries(l)

    #print "Written at "+time.ctime(written)+" v3-ip: "+str(nsips)+\
    #      " v2-ip: "+str(v2ips)+" v3-reqs: "+str(nsreqs)+\
    #      " v2-reqs "+str(v2reqs)
    upgrade_ip_table[written-t0] = nsips/(nsips+(v2ips/8.0))
    upgrade_req_table[written-t0] = nsreqs/(nsreqs+(v2reqs/8.0))

  l = f.readline()


import logistic

(u_ip, s_ip) = logistic.estimate(upgrade_ip_table)
(u_req, s_req) = logistic.estimate(upgrade_req_table)

print "s_ip="+str(s_ip)+", u_ip="+str(u_ip)
print "Estimate 50% IP upgrade at: "+time.ctime(t0+u_ip)

print "s_req="+str(s_req)+", u_req="+str(u_req)
print "Estimate 50% REQ upgrade at: "+time.ctime(t0+u_req)
示例#3
0
#!/usr/bin/python

# Parses metrics.git/out/dirarch/platforms.csv and estimates logistic
# distribution parameters based on this data.

import time
import math

import logistic

f = open("platforms.csv", "r")
f.readline()

upgrade_table = {}
t0 = 0
for l in f.readlines():
    v = l.split(",")
    if v[5] == "NA" or int(v[5]) == 0: continue
    up = (float(v[5]) + float(v[6]) + float(v[7])) / float(v[8])
    t = time.mktime(time.strptime(v[0], "%Y-%m-%d"))
    if t0 == 0: t0 = t
    upgrade_table[t - t0] = up

(u, s) = logistic.estimate(upgrade_table)

print "s=" + str(s) + ", u=" + str(u)
print "Estimate 50% upgrade at: " + time.ctime(t0 + u)
示例#4
0
    nsreqs = total_countries(l)
    l = f.readline()
    while l and not l.startswith("ns-v2-ips"): l = f.readline()
    v2reqs = total_countries(l)
    l = f.readline()
    while l and not l.startswith("n-ns-reqs"): l = f.readline()
    nsips = total_countries(l)
    l = f.readline()
    while l and not l.startswith("n-v2-ns-reqs"): l = f.readline()
    v2ips = total_countries(l)

    #print "Written at "+time.ctime(written)+" v3-ip: "+str(nsips)+\
    #      " v2-ip: "+str(v2ips)+" v3-reqs: "+str(nsreqs)+\
    #      " v2-reqs "+str(v2reqs)
    upgrade_ip_table[written-t0] = nsips/(nsips+(v2ips/8.0))
    upgrade_req_table[written-t0] = nsreqs/(nsreqs+(v2reqs/8.0))

  l = f.readline()


import logistic

(u_ip, s_ip) = logistic.estimate(upgrade_ip_table)
(u_req, s_req) = logistic.estimate(upgrade_req_table)

print "s_ip="+str(s_ip)+", u_ip="+str(u_ip)
print "Estimate 50% IP upgrade at: "+time.ctime(t0+u_ip)

print "s_req="+str(s_req)+", u_req="+str(u_req)
print "Estimate 50% REQ upgrade at: "+time.ctime(t0+u_req)