MCPcopy
hub / github.com/grafana/tempo / testName

Function testName

pkg/traceql/ast_test.go:1117–1138  ·  view source on GitHub ↗
(val any)

Source from the content-addressed store, hash-verified

1115}
1116
1117func testName(val any) string {
1118 if val == nil {
1119 return "nil"
1120 }
1121
1122 switch v := val.(type) {
1123 case float64:
1124 return fmt.Sprintf("%e", v)
1125 case []int:
1126 return fmt.Sprintf("[%d]int", len(v))
1127 case []float64:
1128 return fmt.Sprintf("[%d]float", len(v))
1129 case []string:
1130 return fmt.Sprintf("[%d]str", len(v))
1131 case []bool:
1132 return fmt.Sprintf("[%d]bool", len(v))
1133 case Static:
1134 return v.EncodeToString(false)
1135 default:
1136 return fmt.Sprintf("%v", v)
1137 }
1138}
1139
1140func TestNeedsFullTrace(t *testing.T) {
1141 dontNeedFullTrace := []string{

Callers 12

TestStatic_IntFunction · 0.85
TestStatic_FloatFunction · 0.85
TestStatic_StringFunction · 0.85
TestStatic_BoolFunction · 0.85
TestStatic_DurationFunction · 0.85
TestStatic_StatusFunction · 0.85
TestStatic_KindFunction · 0.85
TestStatic_IntArrayFunction · 0.85
TestStatic_FloatArrayFunction · 0.85
TestStatic_StringArrayFunction · 0.85
TestStatic_BooleanArrayFunction · 0.85
TestStatic_EqualsFunction · 0.85

Calls 1

EncodeToStringMethod · 0.80

Tested by

no test coverage detected