{"tool":"trace","tool_display":"Trace","intent":"track-method-invoke-chain-exceeding-cost-and-limit","intent_display":"track method invoke chain exceeding cost and limit","title":"Trace Command: track method invoke chain exceeding cost and limit","command_string":"trace <class-pattern> <method-pattern> '#cost > <10>' -n 5","raw_command_string":"trace {{class-pattern}} {{method-pattern}} '#cost > {{10}}' -n 5","description":"Exact CLI syntax to track method invoke chain exceeding cost and limit using Trace.","usage_scenario":"Deploy during deep-dive performance diagnostics when hunting for execution bottlenecks in a distributed microservices architecture. Particularly applicable when suspicious spikes in response time or CPU usage correlate to specific Java classes or methods.","scenario_context":"Use Trace during diagnostics to pinpoint performance bottlenecks effectively.","simulated_output":"Tracking method invoke chain with the following parameters:\n\nClass Pattern: com.example.*\nMethod Pattern: process*\nCost Limit: 10\n\nResults:\n\n| Method Name           | Invocation Count | Total Cost | Average Cost |\n|-----------------------|------------------|------------|--------------|\n| com.example.ServiceA.processData | 8                | 45         | 5.625        |\n| com.example.ServiceB.processData | 6                | 35         | 5.833        |\n| com.example.ServiceC.processData | 5                | 30         | 6.000        |\n\n\nTracking complete. 3 method(s) exceeding cost limit found.","how_to_steps":["Run the command: trace com.example.* process* '#cost > 10' -n 5","Verify output for methods exceeding specified cost limit with invocation counts and costs."],"inferred_category":"Observability","canonical_url":"https://www.syntaxstandard.com/trace/track-method-invoke-chain-exceeding-cost-and-limit"}