1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JMeter チートシート

Last updated at Posted at 2020-02-10

JMeter とは

自動でブラウザ操作をするツール
主にラッシュテストに使う
ちょっとした操作ならpostman の方が優秀だが、
postman は複数スレッドを起動できないため、JMeterを使わざるおえない 

前提

JMeterのインストール先:c:\apache-jmeter-5.2.1

JMeter の起動(画面)

jmeter_view.bat

set JMETER_LANGUAGE=-Duser.language="ja" -Duser.region="JP"
c:\apache-jmeter-5.2.1\bin\jmeter.bat -H "プロキシホスト" -P "プロキシポート" -u "プロキシユーザー" -a "プロキシパスワード" -t honya_rush_test.jmx

1行目:日本語化
2行目:jmeterをviewモードで起動
 起動オプション
 -t:ブラウザ操作の設定を保存するファイル名。初回はファイルがないのでエラーになる

JMeter の設定(画面)

jmeter_view.png

外部から設定した方が便利な設定は、変数にする
書式:${__P(変数名)}

ここでは、スレッド数、Ramp-Up期間、ループ回数を変数にした。

JMeter の起動

起動するごとに日時フォルダを作成し、結果をまるっと保存する設定

jmeter_run.bat
set time_tmp=%time: =0%
set now=%date:/=%%time_tmp:~0,2%%time_tmp:~3,2%%time_tmp:~6,2%

set JMETER_LANGUAGE=-Duser.language="ja" -Duser.region="JP"
c:\apache-jmeter-5.2.1\bin\jmeter.bat -H "プロキシホスト" -P "プロキシポート" -u "プロキシユーザー" -a "プロキシパスワード" -n -t honya_rush_test.jmx -Jthread_count=100 -Jloop_count=100 -Jramp_up=100 -j %now%/jmeter.log -l %now%/jmeter.jtl -e -o %now%/report

1行目、2行目:日時フォルダ名の設定
4行目:日本語化
5行目:jmeterをバッチモードで起動
 起動オプション
 -t:viewモードで作成したファイル名
 -n:jmeterをバッチモードで起動
 -J変数名=値:viewモードで設定した外部設定にした変数に値を入れる
 -j:ログファイル名
 -l:テスト結果出力先ファイル名
 -e:レポートを出力する
 -o:テスト結果出力先フォルダ名

あとがき

-a がパスワード って、passwordの a かな?
-l がテスト結果ということは、もしかして leport??
-j がログファイル名?
genkai-3.gif

覚えられないオプションよりチートシート

おまけ

JMeterのインストール

java8 以上が必要

Apache JMeter 5.2.1 公式

 apache-jmeter-5.2.1.zip zipの直リン(2020/2/10現在)

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?