我是靠谱客的博主 生动夕阳,最近开发中收集的这篇文章主要介绍BeanShellInterpreter: Error invoking bsh method: eval In file: inline evaluation of 问题解决,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

使用 jmeter(版本5.4.1)工具进行 http请求返回后结果处理时, beanshell中的java代码报错"BeanShellInterpreter: Error invoking bsh method: eval In file: inline evaluation of...",详情如下图:

以下为修改前beanshell 脚本部分代码:

 hmGatewayAvg.forEach((key, v) -> {
      float percent = (Float.parseFloat(String.valueOf(v))/finalSumValue);//用每个状态的值除以所有状态累加值,获得状态占比率
      hmGatewaySatus.put(key,percent);//把单个状态名称,单个状态Percent值放入hashmap中
   });

网上查了下,jmeter中的beanshell脚本是不支持java 泛型的。

修改后beanshell代码:

for(Map.Entry entry : hmGatewayAvg.entrySet()){
       float v = entry.getValue();
       String key = entry.getKey();
       float percent = v/finalSumValue;//用每个状态的值除以所有状态累加值,获得状态占比率
       hmGatewaySatus.put(key,percent);//把单个状态名称,单个状态Percent值放入hashmap中
   } 

至此,问题解决。

最后

以上就是生动夕阳为你收集整理的BeanShellInterpreter: Error invoking bsh method: eval In file: inline evaluation of 问题解决的全部内容,希望文章能够帮你解决BeanShellInterpreter: Error invoking bsh method: eval In file: inline evaluation of 问题解决所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(51)

评论列表共有 0 条评论

立即
投稿
返回
顶部