Skip to content

Commit

Permalink
feat: πŸ” enable retrieval metrics in data and visualization
Browse files Browse the repository at this point in the history
Uncommented retrieval metrics in CSV script to activate data extraction for total and successful retrieval requests. Added a new section with plots in the provider markdown file to visualize retrieval success rate and request counts.
  • Loading branch information
davidgasquez committed Oct 31, 2024
1 parent 4b567d3 commit 6732a3f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data/[provider]_daily_metrics.csv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ if [ ! -f "$TMPDIR/storage_providers_metrics.parquet" ]; then
quality_adjusted_power_pibs,
-- Spark Retrieval Metrics
-- total_retrieval_requests,
-- successful_retrieval_requests,
total_retrieval_requests,
successful_retrieval_requests,
-- Sector Events
sector_added_events_count,
Expand Down
65 changes: 65 additions & 0 deletions src/provider/[provider].md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,71 @@
const provider_metrics = FileAttachment(`../data/${observable.params.provider}_daily_metrics.csv`).csv({typed: true});
```


## Retrievals

<div class="grid grid-cols-2">
<div class="card">

```js
resize((width) => Plot.plot({
title: "Retrieval Success Rate",
subtitle: "Percentage of successful retrievals",
x: {label: "Date"},
y: {
grid: true,
label: "Success Rate (%)",
domain: [0, 100]
},
width,
marks: [
Plot.ruleY([0]),
Plot.lineY(provider_metrics, {
x: "date",
y: d => d.successful_retrieval_requests / d.total_retrieval_requests * 100 || 0,
stroke: "orange",
tip: true
})
]
}))
```
</div>
<div class="card">

```js
resize((width) => Plot.plot({
title: "Retrieval Requests",
x: {label: "Date"},
y: {grid: true, label: "Requests"},
width,
marks: [
Plot.ruleY([0]),
Plot.lineY(provider_metrics, {
x: "date",
y: "total_retrieval_requests",
stroke: "steelblue",
tip: true
}),
Plot.lineY(provider_metrics, {
x: "date",
y: "successful_retrieval_requests",
stroke: "seagreen",
tip: true
})
],
color: {
legend: true,
domain: ["Total Requests", "Successful Requests"],
range: ["steelblue", "seagreen"]
}
}))
```
</div>
</div>


## Other Metrics

<div class="grid grid-cols-2">
<div class="card">

Expand Down

0 comments on commit 6732a3f

Please sign in to comment.