Skip to content

Commit

Permalink
Add Helia support by making website plots IPFS implementation agnostic (
Browse files Browse the repository at this point in the history
#80)

* feat: update queries to agnostic IPFS impl schema

* feat: update queries to agnostic IPFS impl schema

* update website content

* Add plot data

* fix helia kubo http comparison graph
  • Loading branch information
dennis-tra committed Oct 20, 2023
1 parent 60cca81 commit 5fe6ec5
Show file tree
Hide file tree
Showing 467 changed files with 1,089,022 additions and 614 deletions.
5 changes: 3 additions & 2 deletions config/plotdefs-website/website-snapshot-http-ratio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ datasets:
select
r.region,
percentiles.val::float/100 percentile,
coalesce(extract('epoch' from percentile_disc(percentiles.val::float/100) within group ( order by m.{{ .Params.metric }} ) filter ( where m.type = 'KUBO' )) /
coalesce(extract('epoch' from percentile_disc(percentiles.val::float/100) within group ( order by m.{{ .Params.metric }} ) filter ( where m.type = 'IPFS' )) /
extract('epoch' from percentile_disc(percentiles.val::float/100) within group ( order by m.{{ .Params.metric }} ) filter ( where m.type = 'HTTP' )), -1) ratio
from measurements m
inner join runs r on r.id = m.run_id
Expand All @@ -22,6 +22,7 @@ datasets:
and m.website = '{{ .Params.website }}'
and m.status_code >= 200
and m.status_code < 400
and r.ipfs_impl = '{{ .Params.impl }}'
group by r.region
) data;
Expand All @@ -34,7 +35,7 @@ tables:
values: "ratio"
colorbar:
title:
text: "Kubo faster | HTTP faster →"
text: "{{ .Params.impl }} faster | HTTP faster →"
side: "right"

layout:
Expand Down
13 changes: 10 additions & 3 deletions config/plotdefs-website/website-snapshot-metric-cdf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ datasets:
r.region,
m.{{ .Params.metric }},
cume_dist() over (partition by r.region order by m.{{ .Params.metric }}) as cumedist
from measurements m inner join runs r on r.id = m.run_id
from measurements m
inner join runs r on r.id = m.run_id
where m.created_at >= {{ .StartOfDay | timestamptz }} - '1 week'::interval
and m.created_at < {{ .StartOfDay | timestamptz }}
and m.website = '{{ .Params.website }}'
and m.type = '{{ .Params.type }}'
and m.{{ .Params.metric }} is not null
and m.status_code >= 200
and m.status_code < 400
and (r.ipfs_impl = '{{ .Params.impl }}' or '{{ .Params.type }}' = 'HTTP')
)
select
cdf.region as region,
Expand All @@ -35,7 +37,12 @@ series:
groupfield: "region"
groupvalue: "*"

# {{ $xrange_max := 0 }}
# {{ $title_label := .Params.type }}
# {{ if eq .Params.type "IPFS" }}
# {{ $title_label = .Params.impl }}
# {{ end }}

# {{ $xrange_max := 0 }}
# {{ if eq .Params.metric "ttfb" }}
# {{ $xrange_max = 2 }}
# {{ else if eq .Params.metric "cls" }}
Expand All @@ -57,7 +64,7 @@ layout:
title:
font:
size: 10
text: 'Data: {{ .EndOfPreviousDay | dayModify "-7" | simpledate}} - {{ .EndOfPreviousDay | simpledate }} ({{ .Params.type }}, {{ .Params.website }}). Source: Tiros.'
text: 'Data: {{ .EndOfPreviousDay | dayModify "-7" | simpledate}} - {{ .EndOfPreviousDay | simpledate }} ({{ $title_label }}, {{ .Params.website }}). Source: Tiros.'
x: 1
xanchor: "right"
y: 0.01
Expand Down
16 changes: 13 additions & 3 deletions config/plotdefs-website/website-snapshot-performance-gauge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ datasets:
extract('epoch' from percentile_disc(0.9) within group ( order by m.fcp ) filter ( where r.region = 'ap-southeast-2' and m.fcp is not null )) p90_fcp_ap_southeast_2,
extract('epoch' from percentile_disc(0.9) within group ( order by m.fcp ) filter ( where r.region = 'af-south-1' and m.fcp is not null )) p90_fcp_af_south_1,
extract('epoch' from percentile_disc(0.9) within group ( order by m.fcp ) filter ( where r.region = 'sa-east-1' and m.fcp is not null )) p90_fcp_sa_east_1
from measurements m inner join runs r on r.id = m.run_id
from measurements m
inner join runs r on r.id = m.run_id
where m.created_at >= {{ .StartOfWeek | timestamptz }} - '1 week'::interval
and m.created_at < {{ .StartOfWeek | timestamptz }}
and m.website = '{{ .Params.website }}'
and m.type = '{{ .Params.type }}'
and m.ttfb is not null
and m.status_code >= 200
and m.status_code < 400
and (r.ipfs_impl = '{{ .Params.impl }}' or '{{ .Params.type }}' = 'HTTP')
- name: "previous"
source: "tiros"
query: >
Expand All @@ -46,14 +48,22 @@ datasets:
extract('epoch' from percentile_disc(0.9) within group ( order by m.fcp ) filter ( where r.region = 'ap-southeast-2' and m.fcp is not null )) p90_fcp_ap_southeast_2,
extract('epoch' from percentile_disc(0.9) within group ( order by m.fcp ) filter ( where r.region = 'af-south-1' and m.fcp is not null )) p90_fcp_af_south_1,
extract('epoch' from percentile_disc(0.9) within group ( order by m.fcp ) filter ( where r.region = 'sa-east-1' and m.fcp is not null )) p90_fcp_sa_east_1
from measurements m inner join runs r on r.id = m.run_id
from measurements m
inner join runs r on r.id = m.run_id
where m.created_at >= {{ .StartOfDay | timestamptz }} - '1 week'::interval
and m.created_at < {{ .StartOfDay | timestamptz }}
and m.website = '{{ .Params.website }}'
and m.type = '{{ .Params.type }}'
and m.ttfb is not null
and m.status_code >= 200
and m.status_code < 400
and (r.ipfs_impl = '{{ .Params.impl }}' or '{{ .Params.type }}' = 'HTTP')
# {{ $title_label := .Params.type }}
# {{ if eq .Params.type "IPFS" }}
# {{ $title_label = .Params.impl }}
# {{ end }}

ttfbScalar: &ttfbScalar
type: "gauge"
Expand Down Expand Up @@ -168,7 +178,7 @@ layout:
title:
font:
size: 10
text: 'Data: {{ .EndOfPreviousDay | dayModify "-7" | simpledate}} - {{ .EndOfPreviousDay | simpledate }} (p90, {{ .Params.type }}, {{ .Params.website }}). Source: Tiros.'
text: 'Data: {{ .EndOfPreviousDay | dayModify "-7" | simpledate}} - {{ .EndOfPreviousDay | simpledate }} (p90, {{ $title_label }}, {{ .Params.website }}). Source: Tiros.'
x: 1
xanchor: "right"
y: 0.103
Expand Down
11 changes: 6 additions & 5 deletions config/plotdefs-website/website-snapshot-probes-count.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ datasets:
where m.created_at >= {{ .StartOfDay | timestamptz }} - '1 week'::interval
and m.created_at < {{ .StartOfDay | timestamptz }}
and m.website = '{{ .Params.website }}'
and r.ipfs_impl = '{{ .Params.impl }}'
and (m.error is null or m.error not like '%ERR_CONNECTION_REFUSED%') -- this is a measurement error and not a website error
)
select
sum(1) filter ( where cte.type = 'KUBO' and not cte.has_error) successful_kubo,
sum(1) filter ( where cte.type = 'IPFS' and not cte.has_error) successful_ipfs,
sum(1) filter ( where cte.type = 'HTTP' and not cte.has_error) successful_http,
sum(1) filter ( where cte.type = 'KUBO' ) total_kubo,
sum(1) filter ( where cte.type = 'IPFS' ) total_ipfs,
sum(1) filter ( where cte.type = 'HTTP' ) total_http
from cte
scalars:
- type: "number"
name: "Kubo"
name: "{{ .Params.impl }}"
dataset: "current"
value: "successful_kubo"
value: "successful_ipfs"
- type: "number"
name: "HTTP"
dataset: "current"
Expand All @@ -38,7 +39,7 @@ layout:
title:
font:
size: 10
text: 'Data: {{ .EndOfPreviousDay | dayModify "-7" | simpledate}} - {{ .EndOfPreviousDay | simpledate }} ({{ .Params.website }}). Source: Tiros.'
text: 'Data: {{ .EndOfPreviousDay | dayModify "-7" | simpledate}} - {{ .EndOfPreviousDay | simpledate }} ({{ .Params.impl }}, {{ .Params.website }}). Source: Tiros.'
x: 1
xanchor: "right"
y: 0.01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ datasets:
*,
(m.ttfb is null and m.lcp is null and m.fcp is null and m.tti is null and m.cls is null) or m.status_code >= 400 or m.status_code < 200 has_error
from measurements m
inner join runs r on r.id = m.run_id
inner join runs r on r.id = m.run_id
where m.created_at >= {{ .StartOfDay | timestamptz }} - '1 week'::interval
and m.created_at < {{ .StartOfDay | timestamptz }}
and m.website = '{{ .Params.website }}'
and r.ipfs_impl = '{{ .Params.impl }}'
and (m.error is null or m.error not like '%ERR_CONNECTION_REFUSED%') -- this is a measurement error and not a website error
) select
cte.region,
cte.type,
case
when cte.type::text = 'IPFS' then '{{ .Params.impl }}'
else cte.type::text
end as type,
100 * coalesce(sum(1) filter ( where cte.has_error), 0)::FLOAT / coalesce(sum(1), 0) pct_errors,
100 * coalesce(sum(1) filter ( where not cte.has_error), 0)::FLOAT / coalesce(sum(1), 0) pct_success,
count(*) total
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ datasets:
where m.created_at >= {{ .StartOfDay | timestamptz }} - '1 week'::interval
and m.created_at < {{ .StartOfDay | timestamptz }}
and r.region = '{{ .Params.region }}'
and (r.ipfs_impl = '{{ .Params.impl }}' or '{{ .Params.type }}' = 'HTTP')
and m.type = '{{ .Params.type }}'
and m.website = '{{ .Params.website }}'
and (m.error is null or m.error not like '%ERR_CONNECTION_REFUSED%') -- this is a measurement error and not a website error
Expand Down Expand Up @@ -105,10 +106,15 @@ series:
color: "red"
hovertemplate: "%{x} %{y:.1f}%"

# {{ $title_label := .Params.type }}
# {{ if eq .Params.type "IPFS" }}
# {{ $title_label = .Params.impl }}
# {{ end }}

layout:
barmode: "stack"
title:
text: 'Data: {{ .EndOfPreviousDay | dayModify "-7" | simpledate}} - {{ .EndOfPreviousDay | simpledate }}<br>({{ .Params.type }}, {{ .Params.region }}, {{ .Params.website }}). Source: Tiros.'
text: 'Data: {{ .EndOfPreviousDay | dayModify "-7" | simpledate}} - {{ .EndOfPreviousDay | simpledate }}<br>({{ $title_label }}, {{ .Params.region }}, {{ .Params.website }}). Source: Tiros.'
font:
size: 10
x: 1
Expand Down
10 changes: 8 additions & 2 deletions config/plotdefs-website/website-trend-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ datasets:
where m.created_at >= {{ .StartOfDay | timestamptz }} - '30d'::interval
and m.created_at < {{ .StartOfDay | timestamptz }}
and m.website = '{{ .Params.website }}'
and m.type = 'KUBO'
and m.type = '{{ .Params.type }}'
and (r.ipfs_impl = '{{ .Params.impl }}' or '{{ .Params.type }}' = 'HTTP')
and ((m.status_code >= 200 and m.status_code < 400) or m.status_code is null)
group by date_trunc('day', m.created_at)
)
Expand Down Expand Up @@ -50,6 +51,11 @@ series:
labels: "date"
values: "p90_tti_rolling"

# {{ $title_label := .Params.type }}
# {{ if eq .Params.type "IPFS" }}
# {{ $title_label = .Params.impl }}
# {{ end }}

layout:
yaxis:
autorange: true
Expand All @@ -65,7 +71,7 @@ layout:
title:
font:
size: 10
text: "(p90, {{ .Params.website }}). Source: Tiros."
text: "(p90, {{ $title_label }}, {{ .Params.website }}). Source: Tiros."
x: 1
xanchor: "right"
y: 0.01
Expand Down
10 changes: 8 additions & 2 deletions config/plotdefs-website/website-trend-retrieval-errors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ datasets:
and m.created_at < {{ .StartOfDay | timestamptz }}
and m.website = '{{ .Params.website }}'
and m.type = '{{ .Params.type }}'
and (r.ipfs_impl = '{{ .Params.impl }}' or '{{ .Params.type }}' = 'HTTP')
and (m.error is null or m.error not like '%ERR_CONNECTION_REFUSED%') -- this is a measurement error and not a website error
), series as (
select
Expand All @@ -35,7 +36,7 @@ datasets:
series:
- type: "bar"
name: "Kubo"
name: "{{ .Params.impl }}"
dataset: "current"
color: "blue"
labels: "date"
Expand All @@ -48,6 +49,11 @@ series:
color: "black"
yaxis: "y2"

# {{ $title_label := .Params.type }}
# {{ if eq .Params.type "IPFS" }}
# {{ $title_label = .Params.impl }}
# {{ end }}

layout:
legend:
orientation: "h"
Expand All @@ -66,7 +72,7 @@ layout:
title:
font:
size: 10
text: "({{ .Params.type }}, {{ .Params.website }}). Source: Tiros."
text: "({{ .Params.website }}). Source: Tiros."
x: 1
xanchor: "right"
y: 0.01
Expand Down
22 changes: 15 additions & 7 deletions config/plotdefs-website/websites-http-comparison.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,30 @@ datasets:
query: >
select
r.region,
percentile_cont(0.{{ .Params.percentile }}) within group ( order by m.{{ .Params.metric }} ) filter ( where m.type = 'KUBO' ) p{{ .Params.percentile }}_kubo,
percentile_cont(0.{{ .Params.percentile }}) within group ( order by m.{{ .Params.metric }} ) filter ( where m.type = 'HTTP' ) p{{ .Params.percentile }}_http
coalesce(percentile_cont(0.{{ .Params.percentile }}) within group ( order by m.{{ .Params.metric }} ) filter ( where m.type = 'IPFS' and r.ipfs_impl = 'KUBO' ), '0 seconds'::interval) p{{ .Params.percentile }}_kubo,
coalesce(percentile_cont(0.{{ .Params.percentile }}) within group ( order by m.{{ .Params.metric }} ) filter ( where m.type = 'IPFS' and r.ipfs_impl = 'HELIA' ), '0 seconds'::interval) p{{ .Params.percentile }}_helia,
coalesce(percentile_cont(0.{{ .Params.percentile }}) within group ( order by m.{{ .Params.metric }} ) filter ( where m.type = 'HTTP' ), '0 seconds'::interval) p{{ .Params.percentile }}_http
from measurements m
inner join runs r on r.id = m.run_id
where m.created_at >= {{ .StartOfDay | timestamptz }} - '1 week'::interval
and m.created_at < {{ .StartOfDay | timestamptz }}
and m.status_code >= 200
and m.status_code < 400
inner join runs r on r.id = m.run_id
where m.created_at >= {{ .StartOfDay | timestamptz }} - '1 week'::interval
and m.created_at < {{ .StartOfDay | timestamptz }}
and m.status_code >= 200
and m.status_code < 400
group by r.region
series:
- type: "bar"
name: "Helia"
dataset: "current"
labels: "region"
values: "p{{ .Params.percentile }}_helia"
color: "red"
- type: "bar"
name: "Kubo"
dataset: "current"
labels: "region"
values: "p{{ .Params.percentile }}_kubo"
color: "blue"
- type: "bar"
name: "HTTP"
dataset: "current"
Expand Down
8 changes: 7 additions & 1 deletion config/plotdefs-website/websites-web-vitals-heatmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ datasets:
and m.type = '{{ .Params.type }}'
and m.status_code >= 200
and m.status_code < 400
and (r.ipfs_impl = '{{ .Params.impl }}' or '{{ .Params.type }}' = 'HTTP')
group by r.region, m.website;
tables:
Expand All @@ -28,14 +29,19 @@ tables:
text: "Latency in s"
side: "right"

# {{ $title_label := .Params.type }}
# {{ if eq .Params.type "IPFS" }}
# {{ $title_label = .Params.impl }}
# {{ end }}

layout:
automargin: true
margin:
b: 30
title:
font:
size: 10
text: 'Data: {{ .EndOfPreviousDay | dayModify "-7" | simpledate}} - {{ .EndOfPreviousDay | simpledate }} (p{{ .Params.percentile }}, {{ .Params.metric }}, {{ .Params.type }}). Source: Tiros.'
text: 'Data: {{ .EndOfPreviousDay | dayModify "-7" | simpledate}} - {{ .EndOfPreviousDay | simpledate }} (p{{ .Params.percentile }}, {{ .Params.metric }}, {{ $title_label }}). Source: Tiros.'
x: 0.99
xanchor: "right"
y: 0.01
Expand Down
Loading

0 comments on commit 5fe6ec5

Please sign in to comment.