Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
try to fix zero division error
  • Loading branch information
korolvvn authored Feb 16, 2021
1 parent 107cf72 commit c7256fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace gkeUsageMetering {
SUM(usage.amount) AS amount,
usage.unit AS usage_unit,
SUM(cost) AS cost,
SUM(cost) / SUM(usage.amount) AS rate
SAFE_DIVIDE(SUM(cost), SUM(usage.amount)) AS rate
FROM
\`${fullGCPBillingExportTableID}\`
WHERE
Expand Down Expand Up @@ -272,7 +272,7 @@ namespace gkeUsageMetering {
SUM(usage.amount) AS amount,
usage.unit AS usage_unit,
SUM(cost) AS cost,
SUM(cost) / SUM(usage.amount) AS rate
SAFE_DIVIDE(SUM(cost), SUM(usage.amount)) AS rate
FROM
\`${fullGCPBillingExportTableID}\`
WHERE
Expand Down

0 comments on commit c7256fb

Please sign in to comment.