Comments (8)
Okay, so I think we should make an update to how we are getting the carbon saved values. For reference, this is where we are calculating the emission savings for a project. We are passing in:
- amount: total amount currently stored in TB for the project
- duration: time since creation of the project
- isTBDuration: false (due to the unit we pass in being TB, and not TB*hours)
Unfortunately, this results in the incorrect calculation. Let's say you create a project a year ago, and you have 1TB stored - the calculation will be for the carbon savings of storing 1TB for an entire year, even if you only uploaded that data recently.
Fortunately, the calculation for emission savings supports units already that allow us to fix this and make it accurate; by setting isTBDuration=true, we can pass in an accurate TB*hours value:
- amount: TB*hours stored for the project over some duration (we can decide a month, or since project creation, or whatever)
- duration: disregard; it isn't used in the calculation in this case
- isTBDuration: true
This should make the calculation accurate. I think for now, we could calculate savings over the past month or billing cycle. If it is not bad performance, we could do since project creation - and that would be a cooler number. But there is a risk that that query would be more intensive (not sure if it's something we need to be concerned about though)
from storj.
@boshevski - added this to capture the time period these numbers are for... @mobyvb - I assume this is month to date?
from storj.
@ferristocrat based on conversations with Vitalii, it is "cumulative". However, I think we should look into the math/whitepaper again to ensure that any timeline we put is accurate
from storj.
Thanks Moby. Ideal would be since project creation.
from storj.
We could also display the "Estimated annual carbon at current usage" or similar?
from storj.
from storj.
The stripecoinpayments_invoice_project_records
table stores data in bytes, not byte-hours.
Also, using the bucket_storage_tallies
table since project creation would be incorrect because there are projects created in 2020 that have more than 180,000 rows.
Additionally, using the bucket_storage_tallies table
for annual calculations could be burdensome, as there might be more than 50,000 rows annually.
from storj.
@VitaliiShpital I think we still have a few options:
bucket_storage_tallies
has an index onproject_id, interval_start
, which means it should still be very fast to do summarization queries in SQL that are filtered based on these two columns, even with many rows. We may want to double check the performance, but it may be fine to do even with 100ks of rows (not completely sure - we can ask in the db performance channel)- if for some reason it is unreasonable for us to sum all
bucket_storage_tallies
rows for a project, it should be fine for us to query a smaller and better defined range, e.g. 1 month. In fact, if we did some extra design work, we could connect it to the date selection for graphs on the project dashboard, which already have some limitations about what duration is selected - I don't think we will end up needing to do this, but worst case scenario, we could try to do a conversion of
stripecoinpayments_invoice_project_records
frombytes
tobyte-hours
, e.g. by multiplying each row by the number of hours in a month- on this point, I don't understand why we would even store
bytes
in this table - we are invoicing onbyte-hours
, so why is it that we are storing abytes
value in the table?
- on this point, I don't understand why we would even store
from storj.
Related Issues (20)
- Piecescan and GC don't have log entries with lazy mode off HOT 1
- return project limits from public console api projects endpoint
- Add ability to sort tables in the multinode dashboard HOT 1
- Satellite self-serve account deletion HOT 2
- self-serve deletion: DB and config updates HOT 2
- Change 'Storj' logo color for storagenode dashboard in dark mode HOT 1
- self-serve deletion: api endpoints and emails
- Satellite UI: Versioning updates HOT 4
- Satellite UI: Upgrade Vuetify
- Satellite UI: Implement date range component
- Satellite UI: Daily usage graph updates
- Object Lock - Object Browser Operations HOT 1
- No mention of bonus on `paystubs` or `payout-history` endpoints
- Link the online score explanation to the online score metric on the dashboard HOT 1
- Satellite UI: Onboarding account type updates HOT 2
- Satellite-managed encryption: Technical doc
- Satellite UI: Object lock modification on existing bucket HOT 2
- Docs: Unclear how to create self hosted storj network HOT 1
- Storagenode Updater refuses to update storagenode binary when storagenode service is not running.
- Suggestion: Colorized `Delete` button for deleting access grants
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storj.