Skip to content

Commit

Permalink
use drives instead of positions for another 60x improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
swiffer committed Oct 9, 2024
1 parent f7d7260 commit e78bfec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grafana/dashboards/charging-stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT (\n SELECT sum(cost)\n FROM charging_processes\n WHERE $__timeFilter(end_date) AND car_id = $car_id\n) / (\n\tSELECT convert_km((max(odometer) - min(odometer))::numeric, '$length_unit')\n\tFROM positions\n\tWHERE $__timeFilter(date) AND car_id = $car_id and ideal_battery_range_km is not null\n) * 100",
"rawSql": "SELECT (\n SELECT sum(cost)\n FROM charging_processes\n WHERE $__timeFilter(end_date) AND car_id = $car_id\n) / (\n\tSELECT convert_km((max(end_km) - min(start_km))::numeric, '$length_unit')\n\tFROM drives\n\tWHERE $__timeFilter(end_date) AND car_id = $car_id\n) * 100",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -2562,6 +2562,6 @@
"timezone": "",
"title": "Charging Stats",
"uid": "-pkIkhmRz",
"version": 10,
"version": 11,
"weekStart": ""
}

0 comments on commit e78bfec

Please sign in to comment.