-
Notifications
You must be signed in to change notification settings - Fork 1
/
SlowEndpoint.java
45 lines (41 loc) · 1.31 KB
/
SlowEndpoint.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package spp.demo.indicator;
import io.micronaut.http.HttpResponse;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;
/**
* This class is used to demonstrate the `Slow Endpoint` indicator. This indicator will be automatically added to
* endpoints with the highest response times and is visible in the gutter to the left of the editor.
* <p>
* <b>Usage:</b>
* N/A (automatically added)
* </p>
* <p>
* <b>Indicator source code:</b>
* <a href="https://github.com/sourceplusplus/jetbrains-commander/blob/master/resources/.spp/plugins/slow-endpoint/plugin.kts">Slow Endpoint</a>
* </p>
*/
@Controller("/indicator")
public class SlowEndpoint {
/**
* Hover your mouse over the turtle icon on line 26 to see the response time (~2000ms).
*/
@Get("/slow-2000ms")
public HttpResponse<Void> slow2000ms() {
try {
Thread.sleep(2000);
} catch (InterruptedException ignore) {
}
return HttpResponse.ok();
}
/**
* Hover your mouse over the turtle icon on line 38 to see the response time (~1000ms).
*/
@Get("/slow-1000ms")
public HttpResponse<Void> slow1000ms() {
try {
Thread.sleep(1000);
} catch (InterruptedException ignore) {
}
return HttpResponse.ok();
}
}