mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add more per-sandbox metadata fields.
This includes important configuration dimensions, as well as performance-sensitive characteristics of the host it is running on. PiperOrigin-RevId: 511338632
This commit is contained in:
committed by
gVisor bot
parent
87a0113a69
commit
ed4bee544e
+10
-5
@@ -20,6 +20,7 @@ package config
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -373,11 +374,15 @@ type BundleName string
|
||||
// MetricMetadata returns key-value pairs that are useful to include in metrics
|
||||
// exported about the sandbox this config represents.
|
||||
func (c *Config) MetricMetadata() map[string]string {
|
||||
metadata := make(map[string]string)
|
||||
metadata["platform"] = c.Platform
|
||||
metadata["network"] = c.Network.String()
|
||||
metadata["coretags"] = strconv.FormatBool(c.EnableCoreTags)
|
||||
return metadata
|
||||
return map[string]string{
|
||||
"platform": c.Platform,
|
||||
"network": c.Network.String(),
|
||||
"numcores": strconv.Itoa(runtime.NumCPU()),
|
||||
"coretags": strconv.FormatBool(c.EnableCoreTags),
|
||||
"overlay": c.Overlay2.String(),
|
||||
"gofermode": "default",
|
||||
"cpuarch": runtime.GOARCH,
|
||||
}
|
||||
}
|
||||
|
||||
// FileAccessType tells how the filesystem is accessed.
|
||||
|
||||
Reference in New Issue
Block a user