{"id":1463,"date":"2015-07-07T19:10:56","date_gmt":"2015-07-07T10:10:56","guid":{"rendered":"http:\/\/www.otwo.jp\/blog\/?p=1463"},"modified":"2017-03-29T10:27:15","modified_gmt":"2017-03-29T01:27:15","slug":"jmeter_study_3","status":"publish","type":"post","link":"https:\/\/www.otwo.jp\/blog\/jmeter_study_3\/","title":{"rendered":"\u3010JMeter\u8b1b\u5ea7\u2462\uff08\u5168\uff13\u56de\uff09\u3011BeanShell PreProcessor"},"content":{"rendered":"<p>\u3069\u3046\u3082\u3001\u958b\u767a2\u90e8\u3067\u30b5\u30fc\u30d0\u62c5\u5f53\u3057\u3066\u308b\u5c71\u672c\u3067\u3059\u3002<\/p>\n<p>3\u56de\u306b\u308f\u305f\u3063\u3066JMeter\uff08\u30b8\u30a7\u30a4\u30e1\u30fc\u30bf\u30fc\uff09\u306e\u7d39\u4ecb\u3092\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u304c\u6700\u7d42\u56de\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u524d\u56de\u306f\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u9001\u3089\u308c\u305fjson\u3092\u30d1\u30fc\u30b9\u3057\u3066\u5f8c\u7d9a\u51e6\u7406\u3067\u5229\u7528\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u56de\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u30b5\u30fc\u30d0\u30fc\u306bjson\u30c7\u30fc\u30bf\u3092POST\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p><!--more--><br \/>\n\u25bc\u5168\u8a18\u4e8b\u306f\u3053\u3061\u3089\u3010JMeter\u8b1b\u5ea7\u2462\uff08\u5168\uff13\u56de\uff09\u3011<br \/>\n<a href=\"http:\/\/www.otwo.jp\/blog\/server\/jmeter_study1\/\">\u3010JMeter\u8b1b\u5ea7\u2460\uff08\u5168\uff13\u56de\uff09\u3011\u30ab\u30a6\u30f3\u30bf\uff0fRandom Variable\uff0fCSV Data Set Config<\/a><br \/>\n<a href=\"http:\/\/www.otwo.jp\/blog\/server\/jmeter_study2\/\">\u3010JMeter\u8b1b\u5ea7\u2461\uff08\u5168\uff13\u56de\uff09\u3011\u6b63\u898f\u8868\u73fe\u62bd\u51fa\uff0fBeanShell PostProcessor<\/a><br \/>\n<a href=\"http:\/\/www.otwo.jp\/blog\/server\/jmeter_study_3\/\">\u3010JMeter\u8b1b\u5ea7\u2462\uff08\u5168\uff13\u56de\uff09\u3011BeanShell PreProcessor<\/a><br \/>\n<\/br><\/p>\n<hr \/>\n<p>\u4e88\u3081\u6c7a\u307e\u3063\u305fjson\u3092POST\u3059\u308b\u5834\u5408\u306f\u3001<br \/>\nHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u300cPOST\u300d\u306b\u8a2d\u5b9a\u3057\u3001Body Data\u306bjson\u6587\u5b57\u5217\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<\/br><br \/>\n<a href=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291352.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291352.png\" alt=\"201505291352\" width=\"1000\" height=\"543\" class=\"alignnone size-full wp-image-1424\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291352.png 1000w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291352-300x162.png 300w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291353.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291353.png\" alt=\"201505291353\" width=\"1000\" height=\"543\" class=\"alignnone size-full wp-image-1425\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291353.png 1000w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291353-300x162.png 300w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291354.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291354.png\" alt=\"201505291354\" width=\"1000\" height=\"543\" class=\"alignnone size-full wp-image-1426\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291354.png 1000w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291354-300x162.png 300w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p><\/br><br \/>\n\u52d5\u7684\u306bjson\u3092\u69cb\u7bc9\u3059\u308b\u5834\u5408\u306f\u524d\u51e6\u7406\u3092\u4f7f\u3046\u3068\u3088\u3044\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306e\u4f8b\u3067\u306fBeanShell PreProcessor\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\nBeanShell PreProcessor\u306f\u300c\u524d\u51e6\u7406\u300d\u300cBeanShell PreProcessor\u300d\u304b\u3089\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002<br \/>\njson\u3092\u6271\u3046\u306e\u306bJSONObject\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u524d\u56de\u3068\u540c\u69d8\u306bjar\u306e\u8ffd\u52a0\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n<\/br><br \/>\n<a href=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291414.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291414.png\" alt=\"201505291414\" width=\"1000\" height=\"543\" class=\"alignnone size-full wp-image-1427\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291414.png 1000w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291414-300x162.png 300w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291415.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291415.png\" alt=\"201505291415\" width=\"1000\" height=\"543\" class=\"alignnone size-full wp-image-1428\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291415.png 1000w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291415-300x162.png 300w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><br \/>\n<\/br><br \/>\n\u2191\u306e\u3088\u3046\u306bBodyData\u5168\u4f53\u3092\u5909\u6570\u306b\u3057\u3066\u304a\u304f\u3068\u524d\u51e6\u7406\u3067\u67d4\u8edf\u306bjson\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002<br \/>\n<\/br><br \/>\n<a href=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291416.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291416.png\" alt=\"201505291416\" width=\"1000\" height=\"543\" class=\"alignnone size-full wp-image-1429\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291416.png 1000w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291416-300x162.png 300w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291417.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291417.png\" alt=\"201505291417\" width=\"1000\" height=\"543\" class=\"alignnone size-full wp-image-1430\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291417.png 1000w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291417-300x162.png 300w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291418.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291418.png\" alt=\"201505291418\" width=\"1000\" height=\"543\" class=\"alignnone size-full wp-image-1431\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291418.png 1000w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291418-300x162.png 300w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><br \/>\n<\/br><\/p>\n<pre class=\"brush: python\r; notranslate\">import org.json.JSONObject;\r\n\r\nlog.info(\"BeanShell PreProcessor start\");\r\n\r\nJSONObject json = new JSONObject();\r\njson.put(\"user_id\", vars.get(\"user_id\"));\r\n\r\nlog.info(\"post json=\" + json.toString());\r\n\r\nString post_data = json.toString();\r\nvars.put(\"post_data\", post_data);\r\n \r\nlog.info(\"BeanShell PreProcessor end\");\r\n<\/pre>\n<p><\/br><br \/>\nBeanShell PreProcessor\u3067\u306e\u5b9f\u88c5\u5185\u5bb9\u306f\u2191\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<p><\/br><br \/>\n\u3053\u3053\u307e\u3067\u3067\u7d39\u4ecb\u3057\u305f\u524d\u51e6\u7406\u3001\u5f8c\u51e6\u7406\u3001\u5404\u7a2e\u30ed\u30b8\u30c3\u30af\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3001\u8a2d\u5b9a\u30a8\u30ec\u30e1\u30f3\u30c8\u306a\u3069\u3092\u7d44\u307f\u5408\u308f\u305b\u308c\u3070\u3001<br \/>\n\u5b9f\u969b\u306e\u30e6\u30fc\u30b6\u30fc\u64cd\u4f5c\u306b\u8fd1\u3044\u30b7\u30ca\u30ea\u30aa\u306b\u3088\u308b\u8ca0\u8377\u8a66\u9a13\u304c\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291442.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291442.png\" alt=\"201505291442\" width=\"1000\" height=\"543\" class=\"alignnone size-full wp-image-1432\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291442.png 1000w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2015\/06\/201505291442-300x162.png 300w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<hr \/>\n<p><\/br><br \/>\n\u3044\u304b\u304c\u3067\u3057\u305f\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>JMeter\u3092\u4f7f\u3044\u3053\u306a\u305b\u3070\u8ca0\u8377\u8a66\u9a13\u4ee5\u5916\u306b\u3082API\u306e\u52d5\u4f5c\u78ba\u8a8d\u3084\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u306e\u81ea\u52d5\u751f\u6210\u306a\u3069<br \/>\n\u8ca0\u8377\u8a66\u9a13\u4ee5\u5916\u306e\u30d5\u30a7\u30fc\u30ba\u3067\u3082\u5f79\u7acb\u3064\u5834\u9762\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u4f5c\u696d\u306e\u52b9\u7387\u5316\u306e\u305f\u3081\u306b\u3082\u305c\u3072\u3068\u3082\u4f7f\u3044\u3053\u306a\u3057\u305f\u3044\u3067\u3059\u306d\uff01\uff01<br \/>\n<\/br><br \/>\n\u3068\u3053\u308d\u3067\u3001<br \/>\n\u30aa\u30fc\u30c4\u30fc\u3067\u306f\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u52df\u96c6\u3057\u3066\u3044\u307e\u3059\uff01<br \/>\n<a href=\"http:\/\/www.otwo.jp\/contents\/recruit\/soc_webengineers.php\" target=\"_blank\">\u3053\u3061\u3089<\/a>\u306e\u63a1\u7528\u60c5\u5831\u304b\u3089\u306e\u3054\u5fdc\u52df\u3092\u304a\u5f85\u3061\u3057\u3066\u307e\u3059m(_ _)m<\/p>\n<p>\u3067\u306f\u3067\u306f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u3046\u3082\u3001\u958b\u767a2\u90e8\u3067\u30b5\u30fc\u30d0\u62c5\u5f53\u3057\u3066\u308b\u5c71\u672c\u3067\u3059\u3002 3\u56de\u306b\u308f\u305f\u3063\u3066JMeter\uff08\u30b8\u30a7\u30a4\u30e1\u30fc\u30bf\u30fc\uff09\u306e\u7d39\u4ecb\u3092\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u304c\u6700\u7d42\u56de\u3068\u306a\u308a\u307e\u3059\u3002 \u524d\u56de\u306f\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u9001\u3089\u308c\u305fjson\u3092\u30d1\u30fc\u30b9\u3057\u3066\u5f8c\u7d9a\u51e6\u7406\u3067\u5229\u7528\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":1558,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[9],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/1463"}],"collection":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/comments?post=1463"}],"version-history":[{"count":6,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/1463\/revisions"}],"predecessor-version":[{"id":2906,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/1463\/revisions\/2906"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/media\/1558"}],"wp:attachment":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/media?parent=1463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/categories?post=1463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/tags?post=1463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}