import glob
import pandas as pd
import altair as alt
from altair.expr import datum
frames = []
for pkl in glob.glob("*-main.pkl"):
df = pd.read_pickle(pkl)
df["has_index"] = "no index"
frames.append(df)
for pkl in glob.glob("*-metricssss.pkl"):
df = pd.read_pickle(pkl)
df["has_index"] = "index"
frames.append(df)
df = pd.concat(frames)
df
24h | 7d | 30d | time | users | db | has_index | |
---|---|---|---|---|---|---|---|
0 | 16 | 51 | 73 | 0.012844 | 100 | postgres | no index |
1 | 16 | 51 | 73 | 0.005290 | 100 | postgres | no index |
2 | 16 | 51 | 73 | 0.003802 | 100 | postgres | no index |
3 | 22 | 67 | 107 | 0.009735 | 150 | postgres | no index |
4 | 22 | 67 | 107 | 0.005233 | 150 | postgres | no index |
... | ... | ... | ... | ... | ... | ... | ... |
49 | 11269 | 29956 | 49099 | 0.016288 | 65409 | postgres | index |
50 | 11269 | 29956 | 49099 | 0.016571 | 65409 | postgres | index |
51 | 16991 | 45051 | 73623 | 0.055377 | 98113 | postgres | index |
52 | 16991 | 45051 | 73623 | 0.031337 | 98113 | postgres | index |
53 | 16991 | 45051 | 73623 | 0.024112 | 98113 | postgres | index |
318 rows × 7 columns
charts = alt.hconcat().resolve_scale(y='shared')
base_chart = alt.Chart(df).encode(
x=alt.X("users", scale=alt.Scale(type="log")),
y=alt.Y("time", scale=alt.Scale(type="log")),
color="has_index",
)
for db in df.db.unique():
chart = base_chart.transform_filter(datum.db == db)
chart.title = db
points = chart.mark_point().encode()
line = chart.mark_line().encode(
y=alt.Y("mean(time)", scale=alt.Scale(type="log")),
)
bar = chart.mark_errorbar(extent="ci")
charts |= (points + line + bar).interactive()
charts