()
| 116 | |
| 117 | |
| 118 | def plot_function_scheduling_latency(): |
| 119 | def get_per_invocation(path): |
| 120 | df = pd.read_csv(path) |
| 121 | |
| 122 | df['responseTime'] -= df['actualDuration'] |
| 123 | df['responseTime'] /= 1000 # to ms |
| 124 | |
| 125 | return cdf(df, 'responseTime') |
| 126 | |
| 127 | def get_per_function(path): |
| 128 | df = pd.read_csv(path) |
| 129 | |
| 130 | df['responseTime'] -= df['actualDuration'] |
| 131 | df['responseTime'] /= 1000 # to ms |
| 132 | |
| 133 | df = df.apply(lambda x: x.replace({'(\-[0-9]+(\-[0-9]+\-deployment\-[0-9A-Za-z\-]+){0,1})$': ""}, regex=True)) |
| 134 | |
| 135 | test = df.groupby('instance')['responseTime'].mean().to_frame() |
| 136 | |
| 137 | return cdf(test, 'responseTime') |
| 138 | |
| 139 | fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4)) |
| 140 | |
| 141 | if os.path.exists(knative_path): |
| 142 | ax1.plot(get_per_invocation(knative_path), label='Knative', color='tab:blue', linestyle='dotted') |
| 143 | ax2.plot(get_per_function(knative_path), label='Knative', color='tab:blue', linestyle='dotted') |
| 144 | |
| 145 | if os.path.exists(dirigent_containerd): |
| 146 | ax1.plot(get_per_invocation(dirigent_containerd), label='Dirigent', color='tab:green') |
| 147 | ax2.plot(get_per_function(dirigent_containerd), label='Dirigent', color='tab:green') |
| 148 | |
| 149 | ax1.set_xlabel('Per-invocation scheduling\nlatency [ms]') |
| 150 | ax1.set_ylabel('CDF') |
| 151 | ax1.set_xscale('log') |
| 152 | ax1.set_xticks([1, 10, 100, 1_000, 10_000, 100_000, 1_000_000]) |
| 153 | ax1.set_xlim([1, 10 ** 6]) |
| 154 | ax1.grid() |
| 155 | ax1.legend() |
| 156 | |
| 157 | ax2.set_xlabel('Average per-function\nscheduling latency [ms]') |
| 158 | ax2.set_ylabel('CDF') |
| 159 | ax2.set_xscale('log') |
| 160 | ax2.set_xticks([1, 10, 100, 1_000, 10_000, 100_000, 1_000_000]) |
| 161 | ax2.set_xlim([1, 10 ** 6]) |
| 162 | ax2.grid() |
| 163 | ax2.legend() |
| 164 | |
| 165 | fig.set_figheight(4) |
| 166 | fig.set_figwidth(8) |
| 167 | |
| 168 | plt.tight_layout() |
| 169 | |
| 170 | plt.savefig("azure_500_scheduling_latency.png") |
| 171 | |
| 172 | |
| 173 | plot_per_function_slowdown() |
no test coverage detected