Skip to content

Commit 73620e1

Browse files
committed
Publish price in a metric
1 parent 1d62ddc commit 73620e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

discovery/discovery.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ func reportLiveAICapacity(ch chan common.OrchestratorDescriptor, caps common.Cap
250250

251251
idleContainersByModelAndOrchestrator := make(map[string]map[string]int)
252252
for _, od := range allOrchInfo {
253+
pricePerUnit := od.RemoteInfo.PriceInfo.PricePerUnit
254+
pixelsPerUnit := od.RemoteInfo.PriceInfo.PixelsPerUnit
255+
// pricePerPixel := new(big.Rat).Quo(pricePerUnit, pixelsPerUnit)
256+
pricePerPixel := float64(pricePerUnit) / float64(pixelsPerUnit)
257+
monitor.AIContainerPricePerPixel(od.LocalInfo.URL.String(), pricePerPixel)
253258
var models map[string]*net.Capabilities_CapabilityConstraints_ModelConstraint
254259
if od.RemoteInfo != nil {
255260
models = getModelCaps(od.RemoteInfo.Capabilities)

0 commit comments

Comments
 (0)