From bf825ea2d211607d10463c8cb82c51de6f1f3203 Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Tue, 16 Jan 2024 22:47:21 +0100 Subject: [PATCH 1/3] Overpriced node indexing --- components/ProviderList.tsx | 30 ++++++++++------------------ pages/network/provider/[node_id].tsx | 22 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/components/ProviderList.tsx b/components/ProviderList.tsx index c901dc0..5c36eae 100644 --- a/components/ProviderList.tsx +++ b/components/ProviderList.tsx @@ -237,16 +237,14 @@ export const ProviderList = ({ endpoint, initialData, enableShowingOfflineNodes Total Earnings - CPU/h - - - Env/h + Monthly cost USD + - Start price + Monthly cost GLM @@ -314,6 +312,11 @@ export const ProviderList = ({ endpoint, initialData, enableShowingOfflineNodes v{provider.version} + {provider.runtimes.vm?.is_overpriced ? ( + + Overpriced + + ) : null} @@ -358,24 +361,13 @@ export const ProviderList = ({ endpoint, initialData, enableShowingOfflineNodes - {priceHashMapOrDefault(provider, "golem.usage.cpu_sec")}{" "} - GLM + {RoundingFunction(provider.runtimes.vm?.monthly_price_usd)}{" "} + $ - {priceHashMapOrDefault(provider, "golem.usage.duration_sec")}{" "} - GLM - - - - - { - ( - provider.runtimes.vm?.properties["golem.com.pricing.model.linear.coeffs"] || - provider.runtimes.wasmtime.properties["golem.com.pricing.model.linear.coeffs"] - ).slice(-1)[0] - }{" "} + {RoundingFunction(provider.runtimes.vm?.monthly_price_glm)}{" "} GLM diff --git a/pages/network/provider/[node_id].tsx b/pages/network/provider/[node_id].tsx index a0b7a42..513f0e4 100644 --- a/pages/network/provider/[node_id].tsx +++ b/pages/network/provider/[node_id].tsx @@ -131,6 +131,7 @@ export const ProviderDetailed = ({ initialData, initialIncome }: { initialData: v{nodeData[0].version} +
{nodeData[0].computing_now ? ( @@ -142,6 +143,13 @@ export const ProviderDetailed = ({ initialData, initialIncome }: { initialData: )}
+ {nodeData[0].runtimes.vm?.is_overpriced ? ( +
+ + Overpriced + +
+ ) : null} @@ -151,6 +159,20 @@ export const ProviderDetailed = ({ initialData, initialIncome }: { initialData: {nodeData[0].runtimes.vm?.properties["golem.inf.cpu.brand"]}

) : null} + {nodeData[0].runtimes.vm?.is_overpriced ? ( +

+ Comparing this node against an AWS {nodeData[0].runtimes.vm?.overpriced_compared_to.name} instance with{" "} + {nodeData[0].runtimes.vm?.overpriced_compared_to.vcpu} cores and{" "} + {nodeData[0].runtimes.vm?.overpriced_compared_to.memory} GB memory shows that +

+ this provider is most likely overpriced. We suggest configuring a pricing setting of: CPU/h 0 GLM, Env/h{" "} + {nodeData[0].runtimes.vm?.suggest_env_per_hour_price} GLM, Start 0 GLM.

which equals the + monthly USD price (${nodeData[0].runtimes.vm?.overpriced_compared_to.price_usd}) of the{" "} + {nodeData[0].runtimes.vm?.overpriced_compared_to.name} instance +

+

This nodes monthly USD cost is ${nodeData[0].runtimes.vm?.monthly_price_usd} +

+ ) : null}
From 62beefa063a8e3b79d8ccd37dd5a61bcf162f914 Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Tue, 16 Jan 2024 23:29:20 +0100 Subject: [PATCH 2/3] Fix math --- pages/network/provider/[node_id].tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/network/provider/[node_id].tsx b/pages/network/provider/[node_id].tsx index 513f0e4..f11aeac 100644 --- a/pages/network/provider/[node_id].tsx +++ b/pages/network/provider/[node_id].tsx @@ -167,10 +167,11 @@ export const ProviderDetailed = ({ initialData, initialIncome }: { initialData:

this provider is most likely overpriced. We suggest configuring a pricing setting of: CPU/h 0 GLM, Env/h{" "} {nodeData[0].runtimes.vm?.suggest_env_per_hour_price} GLM, Start 0 GLM.

which equals the - monthly USD price (${nodeData[0].runtimes.vm?.overpriced_compared_to.price_usd}) of the{" "} + Monthly USD price (${nodeData[0].runtimes.vm?.overpriced_compared_to.price_usd * 730}) of the{" "} {nodeData[0].runtimes.vm?.overpriced_compared_to.name} instance

-

This nodes monthly USD cost is ${nodeData[0].runtimes.vm?.monthly_price_usd} +

This nodes monthly USD cost is ${nodeData[0].runtimes.vm?.monthly_price_usd} which is roughly{" "} + {RoundingFunction(nodeData[0].runtimes.vm?.times_more_expensive)} times more expensive compared to AWS

) : null}
From c99af068783162bc483c9ec16e2134b3a71c8dd9 Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Wed, 17 Jan 2024 00:06:23 +0100 Subject: [PATCH 3/3] Show cheaper than --- components/ProviderList.tsx | 4 ++++ pages/network/provider/[node_id].tsx | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/components/ProviderList.tsx b/components/ProviderList.tsx index 5c36eae..8391ac3 100644 --- a/components/ProviderList.tsx +++ b/components/ProviderList.tsx @@ -316,6 +316,10 @@ export const ProviderList = ({ endpoint, initialData, enableShowingOfflineNodes Overpriced + ) : provider.runtimes.vm?.cheaper_than ? ( + + Great Price + ) : null} diff --git a/pages/network/provider/[node_id].tsx b/pages/network/provider/[node_id].tsx index f11aeac..e5087f3 100644 --- a/pages/network/provider/[node_id].tsx +++ b/pages/network/provider/[node_id].tsx @@ -145,10 +145,16 @@ export const ProviderDetailed = ({ initialData, initialIncome }: { initialData: {nodeData[0].runtimes.vm?.is_overpriced ? (
- + Overpriced
+ ) : nodeData[0].runtimes.vm?.cheaper_than ? ( +
+ + Great Price + +
) : null} @@ -173,6 +179,18 @@ export const ProviderDetailed = ({ initialData, initialIncome }: { initialData:

This nodes monthly USD cost is ${nodeData[0].runtimes.vm?.monthly_price_usd} which is roughly{" "} {RoundingFunction(nodeData[0].runtimes.vm?.times_more_expensive)} times more expensive compared to AWS

+ ) : nodeData[0].runtimes.vm?.cheaper_than ? ( +

+ Comparing this node against an AWS {nodeData[0].runtimes.vm?.cheaper_than.name} instance with{" "} + {nodeData[0].runtimes.vm?.cheaper_than.vcpu} cores and {nodeData[0].runtimes.vm?.cheaper_than.memory} GB + memory shows that +

+ this provider is more cost-effective. The Monthly USD price of the AWS{" "} + {nodeData[0].runtimes.vm?.cheaper_than.name} instance is $( + {nodeData[0].runtimes.vm?.cheaper_than.price_usd * 730}).

+

This node's monthly USD cost is ${nodeData[0].runtimes.vm?.monthly_price_usd}, which is roughly{" "} + {RoundingFunction(nodeData[0].runtimes.vm?.times_cheaper)} times cheaper compared to AWS. +

) : null}