コード例 #1
0
def cpu_rtt():
    host = server_ip
    prev_t = 0
    rtt = pc.verbose_ping(host)
    next_t = psutil.cpu_percent(percpu=False)
    delta = abs(prev_t - next_t)
    prev_t = next_t
    x_axis.append(rtt)
    y_axis.append(delta)
コード例 #2
0
ファイル: 3algo.py プロジェクト: emylincon/caching_ipfs_cli
def plot_graphs(host='35.196.51.199'):
    prev_t = 0
    rtt = pc.verbose_ping(host)
    next_t = psutil.cpu_percent(percpu=False)
    delta = abs(prev_t - next_t)
    prev_t = next_t
    plot_resource_util(rtt, delta)
    plot_relative_frequency()
    plot_changing_freq()
    plot_local_cache_freq()
    plot_performance()
    plt.show()
コード例 #3
0
def plot_graphs():
    host = server_ip
    prev_t = 0
    rtt = pc.verbose_ping(host)
    next_t = psutil.cpu_percent(percpu=False)
    delta = abs(prev_t - next_t)
    prev_t = next_t
    figure('Caching Results')
    plot_resource_util(rtt, delta)
    plot_relative_frequency()
    plot_changing_freq()
    plot_local_cache_freq()
    plot_performance()
    plt.show()
コード例 #4
0
def get_rtt(host):
    rtt = pc.verbose_ping(host)

    return round(rtt, 4)
コード例 #5
0
def get_rtt(host):
    rtt = pc.verbose_ping(host)
    if rtt:
        return round(rtt, 4)
    else:
        return get_rtt(host)
コード例 #6
0
def get_rtt(host):
    rtt = pc.verbose_ping(host)

    return rtt
コード例 #7
0
 def get_delay(self, mec):
     rtt = pc.verbose_ping(mec)
     if rtt:
         return round(rtt, 4)
     else:
         return self.get_delay(mec)