{"id":1143,"date":"2020-03-10T22:03:52","date_gmt":"2020-03-10T13:03:52","guid":{"rendered":"https:\/\/ito-u-oti.com\/?p=1143"},"modified":"2020-07-10T17:34:36","modified_gmt":"2020-07-10T08:34:36","slug":"post-1143","status":"publish","type":"post","link":"https:\/\/ito-u-oti.com\/?p=1143","title":{"rendered":"\u3010JMeter\u3011JMeter\u304b\u3089shell\u3084Python\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>JMeter\u304b\u3089HTTP Request\u3084JDBC\u3092\u5b9f\u884c\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3055\u305b\u308b\u65b9\u6cd5\u3067\u3059\u3002<br>\u3053\u308c\u306b\u3088\u308a\u9593\u63a5\u7684\u306bJMeter\u304b\u3089\u30bf\u30fc\u30df\u30ca\u30eb\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__1\" class=\"wp-block-heading\">shell\u306e\u5b9f\u884c<\/h2>\n\n\n\n<h3 id=\"outline__1_1\" class=\"wp-block-heading\">\u5b9f\u884c\u5bfe\u8c61\u306eshell<\/h3>\n\n\n\n<p>execShell.sh<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\necho 'Hello world shell!!';\necho $JMETER_VALUE;\necho $GLOBAL_VALUE;\n\n<\/pre><\/div>\n\n\n<p>\u6587\u5b57\u5217\u3068\u74b0\u5883\u5909\u6570\u306e\u51fa\u529b\u3092\u3057\u307e\u3059\u3002<br>\u74b0\u5883\u5909\u6570\u306fJmeter\u304b\u3089\u57cb\u3081\u8fbc\u3093\u3067\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__1_2\" class=\"wp-block-heading\">Jmeter\u8a2d\u5b9a<\/h3>\n\n\n\n<p>OS Process Sampler\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2020\/03\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2020-03-10-21.27.19-1024x640.png\" alt=\"\" class=\"wp-image-1144\" width=\"512\" height=\"320\"\/><\/figure>\n\n\n\n<p>\u4e0a\u304b\u3089\u8a2d\u5b9a\u3092\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 id=\"outline__1_2_1\" class=\"wp-block-heading\">Command to Execute<\/h4>\n\n\n\n<h5 id=\"outline__1_2_1_1\" class=\"wp-block-heading\">Command<\/h5>\n\n\n\n<p>shell\u306e\u5b9f\u884c\u306b\u5fc5\u8981\u306abash\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7d76\u5bfe\u30d1\u30b9\u3002<\/p>\n\n\n\n<h5 id=\"outline__1_2_1_2\" class=\"wp-block-heading\">working directory<\/h5>\n\n\n\n<p>shell\u306e\u5b58\u5728\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7d76\u5bfe\u30d1\u30b9\u3002<br>\u4eca\u56de\u306fJmeter\u4e0a\u3067ROOT_PATH\u3068\u3044\u3046\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u7528\u610f\u3057\u3066\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br>\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h5 id=\"outline__1_2_1_3\" class=\"wp-block-heading\">Command Parameters<\/h5>\n\n\n\n<p>bash\u3067\u5b9f\u884c\u3059\u308b\u6642\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3084\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h5 id=\"outline__1_2_1_4\" class=\"wp-block-heading\">Environment Variables<\/h5>\n\n\n\n<p>Jmeter\u4e0a\u3067shell\u306b\u4e0e\u3048\u305f\u3044\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u3001\u74b0\u5883\u5909\u6570\u3068\u3044\u3046\u5f62\u3067\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Name <br>\u74b0\u5883\u5909\u6570\u540d\u3002<\/li><li>Value<br>\u74b0\u5883\u5909\u6570\u306b\u8a2d\u5b9a\u3055\u308c\u308b\u5024\u3002<\/li><\/ul>\n\n\n\n<h4 id=\"outline__1_2_2\" class=\"wp-block-heading\">Standerd streams<\/h4>\n\n\n\n<h5 id=\"outline__1_2_2_1\" class=\"wp-block-heading\">Standerd input\/output\/error<\/h5>\n\n\n\n<p>\u3044\u308f\u3086\u308b\u6a19\u6e96\u51fa\u529b\u3067\u3059\u3002shell\u306e\u5b9f\u884c\u7d50\u679c\u306f\u3053\u3053\u306b\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<br>\u7d76\u5bfe\u30d1\u30b9\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u4e88\u3081\u51fa\u529b\u5148\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u306a\u3044\u3068Jmeter\u3067\u5b9f\u884c\u3057\u305f\u6642\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 id=\"outline__1_2_3\" class=\"wp-block-heading\">Return Code Configration<\/h4>\n\n\n\n<h5 id=\"outline__1_2_3_1\" class=\"wp-block-heading\">Check Return Code Expected Return Code<\/h5>\n\n\n\n<p>shell\u5b9f\u884c\u5f8c\u306eexit\u30b3\u30fc\u30c9\u3092\u691c\u8a3c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 id=\"outline__1_2_4\" class=\"wp-block-heading\">Timeout Configration<\/h4>\n\n\n\n<h5 id=\"outline__1_2_4_1\" class=\"wp-block-heading\">Timeout<\/h5>\n\n\n\n<p>\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6642\u9593\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__1_3\" class=\"wp-block-heading\">\u5b9f\u884c\u7d50\u679c<\/h3>\n\n\n\n<p>\u8a2d\u5b9a\u3057\u305f\u30ed\u30b0\u306b\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>resultShell.log<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nHello world shell!!\njmeter\u304b\u3089shell\u3092\u8d77\u52d5\u3057\u305f\nHello Grobal!!\n<\/pre><\/div>\n\n\n<p>Jmeter\u3067\u8a2d\u5b9a\u3057\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u51fa\u529b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 id=\"outline__2\" class=\"wp-block-heading\">Python\u306e\u5b9f\u884c<\/h2>\n\n\n\n<h3 id=\"outline__2_1\" class=\"wp-block-heading\">\u5b9f\u884c\u5bfe\u8c61\u306ePython<\/h3>\n\n\n\n<p>execPython.py<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport os\n\nif __name__ == '__main__':\n    print(&quot;Hello world python!!&quot;)\n    print(os.environ&#x5B;'JMETER_VALUE'])\n    print(os.environ&#x5B;'GLOBAL_VALUE'])\n\n<\/pre><\/div>\n\n\n<p>shell\u306e\u6642\u3068\u540c\u3058\u3088\u3046\u306b\u6587\u5b57\u5217\u3068\u74b0\u5883\u5909\u6570\u306e\u51fa\u529b\u3092\u3057\u307e\u3059\u3002<br>\u74b0\u5883\u5909\u6570\u306fJmeter\u304b\u3089\u57cb\u3081\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__1_2\" class=\"wp-block-heading\">Jmeter\u8a2d\u5b9a<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2020\/03\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2020-03-10-21.50.48-1024x640.png\" alt=\"\" class=\"wp-image-1145\" width=\"512\" height=\"320\"\/><\/figure>\n\n\n\n<p>\u57fa\u672c\u7684\u306b\u306fshell\u306e\u6642\u3068\u5909\u308f\u308a\u307e\u305b\u3093\u3002<br>command\u306b\u5b9f\u884c\u3059\u308bpython\u306ebin\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__1_3\" class=\"wp-block-heading\">\u5b9f\u884c\u7d50\u679c<\/h3>\n\n\n\n<p>resultPython.log<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nHello world python!!\njmeter\u304b\u3089python\u3092\u8d77\u52d5\u3057\u305f\nHello Grobal!!\n<\/pre><\/div>\n\n\n<p>Jmeter\u3067\u8a2d\u5b9a\u3057\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u51fa\u529b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 id=\"outline__3\" class=\"wp-block-heading\">\u74b0\u5883\u5909\u6570\u3067\u57cb\u3081\u8fbc\u3093\u3060JMeter\u8a2d\u5b9a<\/h2>\n\n\n\n<p>JMeter\u4e0a\u3067\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306fUserDefinedVariables\u3067\u8a2d\u5b9a\u3057\u3001<br>ThreadGroup\u9593\u3067\u5171\u901a\u3057\u3066\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2020\/03\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2020-03-10-21.56.21-1024x640.png\" alt=\"\" class=\"wp-image-1146\" width=\"512\" height=\"320\"\/><\/figure>\n\n\n\n<h2 id=\"outline__4\" class=\"wp-block-heading\">\u53c2\u8003<\/h2>\n\n\n\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/30200997\/how-to-execute-linux-command-or-shell-script-from-apache-jmeter\">How to execute Linux command or shell script from APACHE JMETER<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>JMeter\u304b\u3089HTTP Request\u3084JDBC\u3092\u5b9f\u884c\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3055\u305b\u308b\u65b9\u6cd5\u3067\u3059 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1147,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[267,38,268],"class_list":["post-1143","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-jmeter","tag-python","tag-shell"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1143"}],"version-history":[{"count":2,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1143\/revisions"}],"predecessor-version":[{"id":1227,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1143\/revisions\/1227"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/media\/1147"}],"wp:attachment":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}