--effect-count string 影响的请求条数
--effect-percent string 影响的请求百分比
--value string 返回指定值,仅支持基本类型和字符串类型,如果想返回 null,可以设置为 --value null 。必选项
@RequestMapping(value = "hello")
@ResponseBody
public String hello(String name, int code) {
if (name == null) {
name = "friend";
}
StringBuilder result = null;
try {
result = new StringBuilder(sayHello(name));
} catch (Exception e) {
return e.getMessage() + "\n";
}
return result.toString() + "\n";
}
blade c jvm return --value hello-chaosblade --classname com.example.controller.DubboController --methodname hello --process tomcat
private String sayHello(String name) throws BeansException {
demoService = (DemoService)SpringContextUtil.getBean("demoService");
StringBuilder result = new StringBuilder();
result.append(demoService.sayHello(name));
return result.toString();
}
blade c jvm return --value null --classname com.example.controller.DubboController --methodname sayHello --process tomcat