Skip to content

Commit cf47057

Browse files
committed
📈 Add average piece replication factor to metrics and dashboard visualization
1 parent aaa38c2 commit cf47057

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

‎dbt/macros/filecoin_periodic_metrics.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ users_with_active_deals as (
4040
approx_count_distinct(deals.provider_id) as providers_with_active_deals,
4141
mean(end_epoch - sector_start_epoch) // 2880 as mean_deal_duration_days,
4242
mean(end_epoch - sector_start_epoch) filter (is_verified) // 2880 as mean_verified_deal_duration_days,
43-
mean(end_epoch - sector_start_epoch) filter (not is_verified) // 2880 as mean_regular_deal_duration_days
43+
mean(end_epoch - sector_start_epoch) filter (not is_verified) // 2880 as mean_regular_deal_duration_days,
44+
avg(piece_replication_factor) as average_piece_replication_factor_active_deals
4445
from date_calendar as dc
4546
left join {{ ref('filecoin_state_market_deals') }} as deals
4647
on (deals.sector_start_at <= dc.date + interval '1 {{ period }}')
@@ -317,6 +318,7 @@ select
317318
mean_deal_duration_days,
318319
mean_verified_deal_duration_days,
319320
mean_regular_deal_duration_days,
321+
average_piece_replication_factor_active_deals,
320322
new_client_ids,
321323
new_provider_ids,
322324
new_providers_providing_capacity,

‎numbers/src/data/daily_metrics.csv.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ COPY (
2424
active_address_count_daily,
2525
total_address_count,
2626
clients_with_active_data_gt_1_tibs,
27+
average_piece_replication_factor,
2728
2829
-- Power
2930
raw_power_pibs,

‎numbers/src/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,22 @@ movingAverageLinePlot({
371371
```
372372
</div>
373373
374+
<div class="card" id="average-piece-replication-factor">
375+
376+
```js
377+
movingAverageLinePlot({
378+
metrics,
379+
title: title_anchor("Average Piece Replication Factor", "average-piece-replication-factor"),
380+
subtitle: "Average piece replication of pieces onboarded on a date.",
381+
caption: "Displaying 30-day moving average",
382+
yField: "average_piece_replication_factor",
383+
yLabel: "Piece Replication Factor",
384+
yDomain: [0, 40],
385+
showArea: true,
386+
})
387+
```
388+
</div>
389+
374390
</div>
375391
376392
## Power

0 commit comments

Comments
 (0)