Created
December 7, 2019 15:09
-
-
Save jedbrown/4547c85373d2ff4d81e1f134077995db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas | |
import numpy as np | |
import altair as alt | |
df = pandas.DataFrame({ | |
'instance': ['m6g.12xlarge', 'm5g.16xlarge', 'm5.12xlarge', 'm5ad.4xlarge', 'a1.metal'], | |
'architecture': ['Graviton2', 'Graviton2', 'Skylake 8000', 'EPYC 7000', 'Graviton'], | |
'vCPU': [48, 64, 48, 16, 16], | |
'rate': [1.848, 2.464, 2.304, 0.824, 0.408], | |
'source': ['@_msw_']*3 + ['@AtluriAditya']*2, | |
'time': pandas.to_timedelta(['6m24.243s', '5m17.880s', '9m33.527s', '40m36s', '51m24s']) / np.timedelta64(1, 'm'), | |
}) | |
df['cost'] = df.rate * df.time / 60 | |
df['builds/dollar'] = 1/df.cost | |
points = alt.Chart(df).mark_point().encode( | |
alt.X('time', scale=alt.Scale(type='log')), | |
alt.Y('builds/dollar'), | |
shape='architecture', | |
) | |
text = points.mark_text(align='left', dx=7).encode(text='instance') | |
points.encode(color='source') + text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment