Skip to content

Commit d1926b8

Browse files
committed
Filter out non-graphql stack trace
1 parent 311afea commit d1926b8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

benchmark/run.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,15 @@ def thing(lazy:)
282282
end
283283

284284
def stack_trace_depth(lazy:)
285+
get_depth = -> {
286+
graphql_caller = caller.select { |c| c.include?("graphql") }
287+
graphql_caller.size
288+
}
289+
285290
if lazy
286-
-> { caller.size }
291+
get_depth
287292
else
288-
caller.size
293+
get_depth.call
289294
end
290295
end
291296
end
@@ -320,7 +325,6 @@ def self.profile_stack_depth
320325
GRAPHQL
321326

322327
very_lazy_res = StackDepthSchema.execute(query_str, variables: { lazyThing: true, lazyStackTrace: true })
323-
pp very_lazy_res
324328
lazy_res = StackDepthSchema.execute(query_str, variables: { lazyThing: true, lazyStackTrace: false })
325329
eager_res = StackDepthSchema.execute(query_str, variables: { lazyThing: false, lazyStackTrace: false })
326330
get_depth = ->(result) { result["data"]["thing"]["thing"]["thing"]["thing"]["thing"]["stackTraceDepth"] }

0 commit comments

Comments
 (0)