嗯,我不相信你可以像那样分解端点。但是,我确实知道执行器非常灵活,您可以向该端点添加新指标。看起来您主要对计数器感兴趣,所以我建议使用 Spring boot 具有的 CounterService。
private CounterService counterService;
@Autowired
public MyClassName(CounterService counterService) {
this.counterService = counterService;
}
@RequestMapping(method=RequestMethod.POST)
public String myPostMethod(Object obj) {
counterService.increment("mycontroller.post.method");
//...
return "myPostMethod";
}
@RequestMapping(method=RequestMethod.GET)
public String myGetMethod() {
counterService.increment("mycontroller.get.method");
//...
return "myGetMethod";
}