Skip to content

Commit

Permalink
Merge pull request #202 from threefoldtech/development_fix_view
Browse files Browse the repository at this point in the history
Development fix view
  • Loading branch information
Omarabdul3ziz authored Jun 18, 2023
2 parents aa5b623 + 2a87e6b commit 33287bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion grid-proxy/charts/gridproxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ version: 1.0.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.8.2
appVersion: 0.8.3
8 changes: 5 additions & 3 deletions grid-proxy/internal/explorer/db/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ const (
COALESCE(node_resources_total.cru, 0) as total_cru,
COALESCE(node_resources_total.mru, 0) as total_mru,
COALESCE(node_resources_total.hru, 0) as total_hru,
COALESCE(node_resources_total.sru, 0) as total_sru
COALESCE(node_resources_total.sru, 0) as total_sru,
COALESCE(COUNT(DISTINCT state), 0) as states
FROM contract_resources
JOIN node_contract as node_contract
ON node_contract.resources_used_id = contract_resources.id AND node_contract.state IN ('Created', 'GracePeriod')
Expand All @@ -61,7 +62,7 @@ const (
DROP FUNCTION IF EXISTS node_resources(query_node_id INTEGER);
CREATE OR REPLACE function node_resources(query_node_id INTEGER)
returns table (node_id INTEGER, used_cru NUMERIC, used_mru NUMERIC, used_hru NUMERIC, used_sru NUMERIC, free_mru NUMERIC, free_hru NUMERIC, free_sru NUMERIC, total_cru NUMERIC, total_mru NUMERIC, total_hru NUMERIC, total_sru NUMERIC)
returns table (node_id INTEGER, used_cru NUMERIC, used_mru NUMERIC, used_hru NUMERIC, used_sru NUMERIC, free_mru NUMERIC, free_hru NUMERIC, free_sru NUMERIC, total_cru NUMERIC, total_mru NUMERIC, total_hru NUMERIC, total_sru NUMERIC, states BIGINT)
as
$body$
SELECT
Expand All @@ -76,7 +77,8 @@ const (
COALESCE(node_resources_total.cru, 0) as total_cru,
COALESCE(node_resources_total.mru, 0) as total_mru,
COALESCE(node_resources_total.hru, 0) as total_hru,
COALESCE(node_resources_total.sru, 0) as total_sru
COALESCE(node_resources_total.sru, 0) as total_sru,
COALESCE(COUNT(DISTINCT state), 0) as states
FROM contract_resources
JOIN node_contract as node_contract
ON node_contract.resources_used_id = contract_resources.id AND node_contract.state IN ('Created', 'GracePeriod')
Expand Down

0 comments on commit 33287bd

Please sign in to comment.