MCPcopy Create free account
hub / github.com/PostHog/duckgres / parseK8sMemoryMiB

Function parseK8sMemoryMiB

controlplane/control.go:1533–1539  ·  view source on GitHub ↗

parseK8sMemoryMiB parses a Kubernetes memory string into whole mebibytes (MiB = 1024*1024 bytes). Used by compute-usage metering, which counts internally in MiB-seconds. Returns 0 on empty/unparseable input.

(s string)

Source from the content-addressed store, hash-verified

1531 // observability surface.
1532 database = meta.visibleCatalog
1533
1534 // Register the TCP connection so OnWorkerCrash can close it to unblock
1535 // the message loop if the backing worker dies.
1536 sessions.SetConnCloser(pid, tlsConn)
1537 }
1538
1539 // Create real clientConn with FlightExecutor and worker assignment. On the
1540 // lazy path the executor argument must be an untyped nil: a typed-nil
1541 // *flightclient.FlightExecutor would make the QueryExecutor interface
1542 // non-nil and the connection would never activate.

Callers 2

TestParseK8sMemoryMiBFunction · 0.85
workerBillingSizeMethod · 0.85

Calls 1

parseK8sMemoryFunction · 0.85

Tested by 1

TestParseK8sMemoryMiBFunction · 0.68