MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / GetExpvarAsString

Function GetExpvarAsString

base/util.go:901–913  ·  view source on GitHub ↗

Returns string representation of an expvar, given map name and key name

(mapName string, name string)

Source from the content-addressed store, hash-verified

899
900// Returns string representation of an expvar, given map name and key name
901func GetExpvarAsString(mapName string, name string) string {
902 mapVar := expvar.Get(mapName)
903 expvarMap, ok := mapVar.(*expvar.Map)
904 if !ok {
905 return ""
906 }
907 value := expvarMap.Get(name)
908 if value != nil {
909 return value.String()
910 } else {
911 return ""
912 }
913}
914
915// Returns int representation of an expvar, given map name and key name
916func GetExpvarAsInt(mapName string, name string) (int, error) {

Callers 1

GetExpvarAsIntFunction · 0.85

Calls 2

StringMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected