MCPcopy
hub / github.com/dosco/graphjin / BenchmarkStripCacheTrackingFields

Function BenchmarkStripCacheTrackingFields

core/cache_response_test.go:336–349  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

334}
335
336func BenchmarkStripCacheTrackingFields(b *testing.B) {
337 data := []byte(`{"data":{"users":{"__gj_id":1,"id":1,"name":"Ada","posts":[{"__gj_id":10,"id":10,"title":"First"},{"id":11,"title":"Second","__gj_id":11}]}}}`)
338
339 b.ReportAllocs()
340 for i := 0; i < b.N; i++ {
341 cleaned, err := stripCacheTrackingFields(data)
342 if err != nil {
343 b.Fatal(err)
344 }
345 if len(cleaned) == 0 {
346 b.Fatal("empty cleaned response")
347 }
348 }
349}
350
351func TestResponseProcessor_InnerFragmentUsesPrimaryKey(t *testing.T) {
352 qc := &qcode.QCode{

Callers

nothing calls this directly

Calls 1

stripCacheTrackingFieldsFunction · 0.85

Tested by

no test coverage detected