storj/storagenode/storagenodedb
Clement Sam 3d3f9d133a storagenode: fix B*h to bytes disk usage conversion
The used space graph values are correct when a single satellite is
selected but wrong for 'All satellites'. This is related to the
queries for getting the individual disk usages for all satellites
per day and the summary and average for all satellites per day:

1. dividing the sum of at_rest_total by the total_hours is wrong.
Simply put, we were assuming that, for example (4/2)+(6/3) equals
to (4+6)/(2+3), assuming we had 4 and 6 at_rest_total values with
2 and 3 respective hours.

2. To get the average, we need to first find the sum of the
at_rest_total_bytes for each timestamp across all satellites
before taking the average of the sums instead of just taking the
average from the individual satellite values.

Closes https://github.com/storj/storj/issues/5519

Change-Id: Ib1314e238b695a6c1ecd9f9171ee86dd56bb3b24
2023-02-06 18:50:31 +00:00
..
schemagen private/testplanet: disable WAL for storagenodes 2022-12-05 11:41:06 +00:00
storagenodedbtest {storagenode,web/multinode}: fix storage usage db/cache retrieval queries 2022-12-09 11:07:33 +00:00
testdata storagenode/storageusage: add interval_end_time, rename interval_start to timestamp 2022-08-10 01:03:00 +00:00
apikeys.go all: fix error naming 2021-04-29 15:38:21 +03:00
bandwidthdb.go sql: capitalize keywords 2022-03-01 15:19:38 +00:00
database.go private/testplanet: disable WAL for storagenodes 2022-12-05 11:41:06 +00:00
db_container.go private/dbutil: use dbutil and tagsql from storj.io/private 2021-04-23 14:36:52 +03:00
deprecatedinfo.go storagenodedb: reenable utccheck in tests 2019-12-10 23:17:14 +00:00
migrations_test.go private/dbutil: use dbutil and tagsql from storj.io/private 2021-04-23 14:36:52 +03:00
notifications.go all: fix error naming 2021-04-29 15:38:21 +03:00
orders.go all: fix error naming 2021-04-29 15:38:21 +03:00
payouts.go sql: capitalize keywords 2022-03-01 15:19:38 +00:00
pieceexpiration.go all: fix error naming 2021-04-29 15:38:21 +03:00
pieceinfo.go storagenode/storagenodedb: fix fillInBlobAccess 2021-05-25 16:41:10 +00:00
piecespaceused.go all: fix error naming 2021-04-29 15:38:21 +03:00
pricing.go all: fix error naming 2021-04-29 15:38:21 +03:00
reputation.go storagenode/reputation: add vetted at timestamp 2021-07-07 18:11:54 +03:00
satellites.go sql: capitalize keywords 2022-03-01 15:19:38 +00:00
schema.go storagenode/storageusage: add interval_end_time, rename interval_start to timestamp 2022-08-10 01:03:00 +00:00
storageusage.go storagenode: fix B*h to bytes disk usage conversion 2023-02-06 18:50:31 +00:00
usedserials.go storagenode/piecestore: switch usedserials db for in-memory usedserials store 2020-05-28 12:52:52 -04:00