Cool Request Plugin for IDEA: Tracing, MyBatis Function Tracking, and Custom Timing Features

The article introduces the Cool Request IDEA plugin, explains its tracing capabilities for arbitrary packages, automatic MyBatis function monitoring, customizable timing colors, script-based environment manipulation, and provides a Java code example for handling responses, highlighting its usefulness for backend developers.

Architect's Guide
Architect's Guide
Architect's Guide
Cool Request Plugin for IDEA: Tracing, MyBatis Function Tracking, and Custom Timing Features

Cool Request is an IDEA plugin that extends basic HTTP request functionality with powerful reflection capabilities, allowing developers to bypass interceptors and invoke methods annotated with @Scheduled or supported by xxl-job.

The new Trace feature can measure execution time for any non‑Java package, tracking calls from controller methods down to deeper levels based on a configurable depth, though very deep static analysis may be limited.

Trace can also automatically follow MyBatis execution functions, showing precise SQL execution times (e.g., 7 ms) and allowing manual addition of methods when source code is known.

When enabled, the left‑hand “+100” indicator shows that a method was called 100 times, although per‑method duration is not currently displayed.

Users can customize the color highlighting for methods exceeding a specified duration (e.g., >5 ms turns red) via the plugin settings.

The plugin supports scripting to manipulate environment variables, such as automatically adding a token header for authenticated requests, and provides convenient JSON parsing within response scripts using built‑in libraries like ObjectMapper, Gson, or Fastjson.

public void handlerResponse(ILog log, HTTPResponse response, IEnv env) {
    String body = new String(response.getResponseBody());
    log.println(body);
    User user = JSON.parseObject(body, User.class);
    log.println(user.getAge() + "");
}

Overall, Cool Request offers a comprehensive set of tools for backend developers to debug, trace, and customize HTTP interactions directly within the IDE.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendjavapluginspringMyBatistracingIDEA
Architect's Guide
Written by

Architect's Guide

Dedicated to sharing programmer-architect skills—Java backend, system, microservice, and distributed architectures—to help you become a senior architect.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.