generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'kyma-project:main' into main
- Loading branch information
Showing
63 changed files
with
1,189 additions
and
1,384 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 9 additions & 4 deletions
13
src/calculatorFunctions/baseConfigCosts/calculateBaseConfigCosts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import config from '../../config.json'; | ||
|
||
interface Props { | ||
export interface BaseConfigProps { | ||
timeConsumption: number; | ||
vmMultiplier: number; | ||
minAutoscaler: number; | ||
machineTypeFactor: number; | ||
} | ||
|
||
export default function calculateBaseConfigCosts(props: Props): number { | ||
const { timeConsumption, minAutoscaler, vmMultiplier } = props; | ||
export default function calculateBaseConfigCosts( | ||
props: BaseConfigProps, | ||
): number { | ||
const { timeConsumption, minAutoscaler, vmMultiplier, machineTypeFactor } = | ||
props; | ||
|
||
const PPU: number = config.baseConfig.PricePerUnit; | ||
const BaseStorageEventsPPU: number = | ||
config.baseConfig.BaseStorageEventsPricePerUnit; | ||
|
||
return ( | ||
minAutoscaler * timeConsumption * PPU * vmMultiplier + BaseStorageEventsPPU | ||
minAutoscaler * timeConsumption * PPU * vmMultiplier * machineTypeFactor + | ||
BaseStorageEventsPPU | ||
); | ||
} |
15 changes: 0 additions & 15 deletions
15
src/calculatorFunctions/nodeCosts/calculateNodeCosts.test.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 13 additions & 4 deletions
17
src/calculatorFunctions/storageCosts/calculateStorageCosts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
import config from '../../config.json'; | ||
|
||
interface Props { | ||
export interface StorageCostProps { | ||
GBQuantity: number; | ||
premiumGBQuantity: number; | ||
timeConsumption: number; | ||
} | ||
|
||
export default function calculateStorageCosts(props: Props): number { | ||
const { GBQuantity, timeConsumption } = props; | ||
export default function calculateStorageCosts(props: StorageCostProps): number { | ||
const { GBQuantity, premiumGBQuantity, timeConsumption } = props; | ||
const PPU: number = config.Storage.PricePerUnit; | ||
const PPUdivider: number = config.Storage.PricePerUnitDivider; | ||
const PPUdivider2: number = config.Storage.PricePerUnitDivider2; | ||
const premiumPPU: number = config.PremiumStorage.PricePerUnit; | ||
const premiumPPUdivider: number = config.PremiumStorage.PricePerUnitDivider; | ||
const premiumPPUdivider2: number = config.PremiumStorage.PricePerUnitDivider2; | ||
|
||
return (PPU / PPUdivider / PPUdivider2) * timeConsumption * GBQuantity; | ||
return ( | ||
(PPU / PPUdivider / PPUdivider2) * timeConsumption * GBQuantity + | ||
(premiumPPU / premiumPPUdivider / premiumPPUdivider2) * | ||
timeConsumption * | ||
premiumGBQuantity | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
interface Props { | ||
export interface TotalCostsProps { | ||
baseConfigCosts: number; | ||
nodeCosts: number; | ||
storageCosts: number; | ||
additionalCosts: number; | ||
conversionRatio: number; | ||
} | ||
|
||
export default function calculateTotalCosts(props: Props): number { | ||
const { baseConfigCosts, nodeCosts, storageCosts } = props; | ||
return baseConfigCosts + nodeCosts + storageCosts; | ||
export interface TotalCosts { | ||
CU: number; | ||
CC: number; | ||
} | ||
|
||
export default function calculateTotalCosts( | ||
props: TotalCostsProps, | ||
): TotalCosts { | ||
const { baseConfigCosts, storageCosts, additionalCosts, conversionRatio } = | ||
props; | ||
const costInCU = baseConfigCosts + storageCosts + additionalCosts; | ||
return { CU: costInCU, CC: costInCU * conversionRatio }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#CostWizard { | ||
height: 600px; | ||
overflow-x: hidden; | ||
} | ||
|
||
.ButtonContainer { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import React from 'react'; | ||
import { Wizard } from '@ui5/webcomponents-react'; | ||
import BaseConfigStep from './WizardSteps/BaseConfigStep'; | ||
import NodeStep from './WizardSteps/NodeStep'; | ||
import AdditionalConfig from './WizardSteps/AdditionalConfig'; | ||
import StorageStep from './WizardSteps/StorageStep'; | ||
import './CostWizard.css'; | ||
|
||
export default function CostWizard() { | ||
return ( | ||
<Wizard id="CostWizard"> | ||
<BaseConfigStep /> | ||
<NodeStep /> | ||
<StorageStep /> | ||
<AdditionalConfig /> | ||
</Wizard> | ||
); | ||
} |
Oops, something went wrong.