Example #1
0
def main(argv):
    data = read_data_agent_result(sys.argv[1])
    grouped = groupby_globally(data, key)

    print template.format(**headers)

    for (bs, cache_tp, act, conc), curr_data in sorted(grouped.items()):
        iops = med_dev([i['iops'] * int(conc) for i in curr_data])
        bw = med_dev([i['bw'] * int(conc) for i in curr_data])
        lat = med_dev([i['lat'] / 1000 for i in curr_data])

        iops = round_deviation(iops)
        bw = round_deviation(bw)
        lat = round_deviation(lat)

        params = dict(
            bs=bs,
            action=act,
            cache_tp=cache_tp,
            iops=iops,
            bw=bw,
            lat=lat,
            conc=conc
        )

        print template.format(**params)
Example #2
0
def main(argv):
    data = read_data_agent_result(sys.argv[1])
    grouped = groupby_globally(data, key)

    print template.format(**headers)

    for (bs, cache_tp, act, conc), curr_data in sorted(grouped.items()):
        iops = med_dev([i['iops'] * int(conc) for i in curr_data])
        bw = med_dev([i['bw'] * int(conc) for i in curr_data])
        lat = med_dev([i['lat'] / 1000 for i in curr_data])

        iops = round_deviation(iops)
        bw = round_deviation(bw)
        lat = round_deviation(lat)

        params = dict(bs=bs,
                      action=act,
                      cache_tp=cache_tp,
                      iops=iops,
                      bw=bw,
                      lat=lat,
                      conc=conc)

        print template.format(**params)
# # example data
# mu = 100 # mean of distribution
# sigma = 15 # standard deviation of distribution
# x = mu + sigma * np.random.randn(10000)

x = data[0]['res'][sys.argv[2]]['iops']
# mu, sigma = med_dev(x)
# print mu, sigma

# med_sz = 1
# x2 = x[:len(x) // med_sz * med_sz]
# x2 = [sum(vals) / len(vals) for vals in zip(*[x2[i::med_sz]
#                                               for i in range(med_sz)])]

mu, sigma = med_dev(x)
print mu, sigma
print stats.normaltest(x)

num_bins = 20
# the histogram of the data
n, bins, patches = plt.hist(x, num_bins, normed=1, facecolor='green', alpha=0.5)
# add a 'best fit' line

y = mlab.normpdf(bins, mu, sigma)
plt.plot(bins, y, 'r--')

plt.xlabel('Smarts')
plt.ylabel('Probability')
plt.title(r'Histogram of IQ: $\mu={}$, $\sigma={}$'.format(int(mu), int(sigma)))
Example #4
0
# # example data
# mu = 100 # mean of distribution
# sigma = 15 # standard deviation of distribution
# x = mu + sigma * np.random.randn(10000)

x = data[0]['res'][sys.argv[2]]['iops']
# mu, sigma = med_dev(x)
# print mu, sigma

# med_sz = 1
# x2 = x[:len(x) // med_sz * med_sz]
# x2 = [sum(vals) / len(vals) for vals in zip(*[x2[i::med_sz]
#                                               for i in range(med_sz)])]

mu, sigma = med_dev(x)
print mu, sigma
print stats.normaltest(x)

num_bins = 20
# the histogram of the data
n, bins, patches = plt.hist(x,
                            num_bins,
                            normed=1,
                            facecolor='green',
                            alpha=0.5)
# add a 'best fit' line

y = mlab.normpdf(bins, mu, sigma)
plt.plot(bins, y, 'r--')