Skip to content

Commit

Permalink
satellite/emission: added config
Browse files Browse the repository at this point in the history
Added configuration for emission service.

Issue:
#6694

Change-Id: I58aa3fffed657cc510ba425fb1edb62f2eb47bba
  • Loading branch information
VitaliiShpital authored and Storj Robot committed Feb 6, 2024
1 parent dfa7c3c commit 003ce95
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 0 deletions.
32 changes: 32 additions & 0 deletions satellite/emission/config.go
@@ -0,0 +1,32 @@
// Copyright (C) 2024 Storj Labs, Inc.
// See LICENSE for copying information.

package emission

// Config contains configurable values for emission service.
type Config struct {
WriteEnergy float64 `help:"energy needed to write 1GB of data, in W-hours/GB" default:"0.005"`
CO2PerEnergy float64 `help:"amount of carbon emission per unit of energy, in kg/kW-hours" default:"0.2826"`
ShortenedDriveLife float64 `help:"shortened hard drive life period, in years" default:"3"`
StandardDriveLife float64 `help:"standard hard drive life period, in years" default:"4"`
ExtendedDriveLife float64 `help:"extended hard drive life period, in years" default:"6"`
NewDriveEmbodiedCarbon float64 `help:"carbon footprint of producing 1TB HDD, in kg/TB" default:"20"`
CarbonFromDrivePowering float64 `help:"carbon from power per year of operations, in kg/TB-year" default:"15.9"`
RepairedData float64 `help:"amount of repaired data, in TB" default:"667"`
ExpandedData float64 `help:"amount of expanded data, in TB" default:"48689"`
StorjGCPCarbon float64 `help:"amount of carbon emission from storj GCP, in kg" default:"3600"`
StorjCRDBCarbon float64 `help:"amount of carbon emission from storj CRDB, in kg" default:"2650"`
StorjEdgeCarbon float64 `help:"amount of carbon emission from storj Edge, in kg" default:"10924"`
StorjExpandedNetworkStorage float64 `help:"amount of expanded network storage, in TB" default:"18933"`
HyperscalerExpansionFactor float64 `help:"expansion factor of hyperscaler networks" default:"3"`
CorporateDCExpansionFactor float64 `help:"expansion factor of corporate data center networks" default:"4"`
StorjExpansionFactor float64 `help:"expansion factor of storj network" default:"2.7"`
HyperscalerRegionCount float64 `help:"region count of hyperscaler networks" default:"2"`
CorporateDCRegionCount float64 `help:"region count of corporate data center networks" default:"2"`
StorjRegionCount float64 `help:"region count of storj network" default:"1"`
StorjStandardNetworkWeighting float64 `help:"network weighting of already provisioned, powered drives, in fraction" default:"0.21"`
StorjNewNetworkWeighting float64 `help:"network weighting of new nodes, in fraction" default:"0.582"`
HyperscalerUtilizationFraction float64 `help:"utilization fraction of hyperscaler networks, in fraction" default:"0.75"`
CorporateDCUtilizationFraction float64 `help:"utilization fraction of corporate data center networks, in fraction" default:"0.40"`
StorjUtilizationFraction float64 `help:"utilization fraction of storj network, in fraction" default:"0.85"`
}
17 changes: 17 additions & 0 deletions satellite/emission/service.go
@@ -0,0 +1,17 @@
// Copyright (C) 2024 Storj Labs, Inc.
// See LICENSE for copying information.

package emission

// Service is an emission service.
// Performs emissions impact calculations.
//
// architecture: Service
type Service struct {
config *Config
}

// NewService creates a new ImpactCalculator with the given configuration.
func NewService(config *Config) *Service {
return &Service{config: config}
}
3 changes: 3 additions & 0 deletions satellite/peer.go
Expand Up @@ -43,6 +43,7 @@ import (
"storj.io/storj/satellite/console/userinfo"
"storj.io/storj/satellite/contact"
"storj.io/storj/satellite/durability"
"storj.io/storj/satellite/emission"
"storj.io/storj/satellite/gc/bloomfilter"
"storj.io/storj/satellite/gc/piecetracker"
"storj.io/storj/satellite/gc/sender"
Expand Down Expand Up @@ -209,6 +210,8 @@ type Config struct {
EmailReminders emailreminders.Config
ConsoleDBCleanup dbcleanup.Config

Emission emission.Config

AccountFreeze accountfreeze.Config

Version version_checker.Config
Expand Down
72 changes: 72 additions & 0 deletions satellite/satellite-config.yaml.lock
Expand Up @@ -547,6 +547,78 @@ contact.external-address: ""
# amount of time before sending second reminder to users who need to verify their email
# email-reminders.second-verification-reminder: 120h0m0s

# carbon from power per year of operations, in kg/TB-year
# emission.carbon-from-drive-powering: 15.9

# amount of carbon emission per unit of energy, in kg/kW-hours
# emission.co2per-energy: 0.2826

# expansion factor of corporate data center networks
# emission.corporate-dc-expansion-factor: 4

# region count of corporate data center networks
# emission.corporate-dc-region-count: 2

# utilization fraction of corporate data center networks, in fraction
# emission.corporate-dc-utilization-fraction: 0.4

# amount of expanded data, in TB
# emission.expanded-data: 48689

# extended hard drive life period, in years
# emission.extended-drive-life: 6

# expansion factor of hyperscaler networks
# emission.hyperscaler-expansion-factor: 3

# region count of hyperscaler networks
# emission.hyperscaler-region-count: 2

# utilization fraction of hyperscaler networks, in fraction
# emission.hyperscaler-utilization-fraction: 0.75

# carbon footprint of producing 1TB HDD, in kg/TB
# emission.new-drive-embodied-carbon: 20

# amount of repaired data, in TB
# emission.repaired-data: 667

# shortened hard drive life period, in years
# emission.shortened-drive-life: 3

# standard hard drive life period, in years
# emission.standard-drive-life: 4

# amount of carbon emission from storj CRDB, in kg
# emission.storj-crdb-carbon: 2650

# amount of carbon emission from storj Edge, in kg
# emission.storj-edge-carbon: 10924

# amount of expanded network storage, in TB
# emission.storj-expanded-network-storage: 18933

# expansion factor of storj network
# emission.storj-expansion-factor: 2.7

# amount of carbon emission from storj GCP, in kg
# emission.storj-gcp-carbon: 3600

# network weighting of new nodes, in fraction
# emission.storj-new-network-weighting: 0.582

# region count of storj network
# emission.storj-region-count: 1

# network weighting of already provisioned, powered drives, in fraction
# emission.storj-standard-network-weighting: 0.21

# utilization fraction of storj network, in fraction
# emission.storj-utilization-fraction: 0.85

# energy needed to write 1GB of data, in W-hours/GB
# emission.write-energy: 0.005

# set if expired segment cleanup is enabled or not
# expired-deletion.enabled: true

Expand Down

0 comments on commit 003ce95

Please sign in to comment.