@@ -20,6 +20,7 @@ import (
20
20
"context"
21
21
"fmt"
22
22
"strconv"
23
+ "strings"
23
24
"sync"
24
25
25
26
"golang.org/x/time/rate"
@@ -444,6 +445,7 @@ func (r *TensorFusionClusterReconciler) SetupWithManager(mgr ctrl.Manager, addLi
444
445
445
446
// Update metrics recorder's raw billing map
446
447
func (r * TensorFusionClusterReconciler ) updateMetricsRecorder (ctx context.Context , pool * tfv1.GPUPool ) {
448
+ const dollarSign = "$"
447
449
log := log .FromContext (ctx )
448
450
if pool .Spec .QosConfig == nil {
449
451
log .Info ("QosConfig is nil, skip updating metrics recorder" , "pool" , pool .Name )
@@ -456,8 +458,8 @@ func (r *TensorFusionClusterReconciler) updateMetricsRecorder(ctx context.Contex
456
458
}
457
459
pricingDetail := r .MetricsRecorder .WorkerUnitPriceMap [pool .Name ]
458
460
for _ , pricing := range qosConfig .Pricing {
459
- tflopsPerHour , _ := strconv .ParseFloat (pricing .Requests .PerFP16TFlopsPerHour , 64 )
460
- vramPerHour , _ := strconv .ParseFloat (pricing .Requests .PerGBOfVRAMPerHour , 64 )
461
+ tflopsPerHour , _ := strconv .ParseFloat (strings . TrimPrefix ( pricing .Requests .PerFP16TFlopsPerHour , dollarSign ) , 64 )
462
+ vramPerHour , _ := strconv .ParseFloat (strings . TrimPrefix ( pricing .Requests .PerGBOfVRAMPerHour , dollarSign ) , 64 )
461
463
limitOverRequestChargingRatio , _ := strconv .ParseFloat (pricing .LimitsOverRequestsChargingRatio , 64 )
462
464
463
465
pricingDetail [string (pricing .Qos )] = metrics.RawBillingPricing {
0 commit comments