bananan_wの日記: 英語勉強日記#8(翻訳がんばろう日記)
日記 by
bananan_w
7章〜13章までざーっと読んでみたけど、やっぱり需要があるともあんまり思えないんで、パス。
というわけで次は14章。18章まであと少し(ひぃ
14. Introduction to listeners
14. リスナの手引き
A listener is a component that shows the results of the samples. The results can be shown in a tree, tables, graphs or simply written to a log file. To view the contents of a response from any given sampler, add either of the Listeners "View Results Tree" or "View Results in table" to a test plan. To view the response time graphically, add graph results, spline results or distribution graph. The listeners section of the components page has full descriptions of all the listeners.
リスナはサンプルの結果を表示する構成要素です。結果はツリーと表とグラフへの表示、単純にログファイルへの出力に対応しています。複数のサンプルから与えられた応答の内容を見るには、"ツリーで結果を参照"か"表形式で結果を参照"のどちらかのリスナをテスト計画に追加します。応答時間をグラフで表示するにはグラフ結果を追加し、スプライン曲線がグラフに表示されるでしょう(訳注:ここものすごく超訳)。リスナ(訳注:Aタグ注意)セクションには全てのリスナに対する完全な解説が記されています。
Different listeners display the response information in different ways. However, they all write the same raw data to the output file - if one is specified.
それぞれのリスナは異なる方法で応答の情報を表示します。その一方、指定されていれば、リスナは同一のRAWデータをファイルに出力します。
The "Configure" button can be used to specify which fields to write to the file, and whether to write it as CSV or XML. CSV files are much smaller than XML files, so use CSV if you are generating lots of samples.
"設定"ボタンによってファイルに出力する項目の決定と、CSVかXML形式どちらで書き込むかを指定できます。CSVファイルはXMLファイルよりサイズが小さいため、CSVではより多くのサンプルを保存できます。
If you only wish to record certain samples, add the Listener as a child of the sampler. Or you can use a Simple Controller to group a set of samplers, and add the Listener to that. The same filename can be used by multiple samplers - but make sure they all use the same configuration!
特定のサンプルの保存だけを行ないたい場合には、該当するサンプラの子要素としてリスナを追加してください。もしくは、サンプラのグループにシンプルコントローラを使用し、リスナをコントローラの子要素として追加します。複数のサンプラに同一のファイル名を指定できます。しかし、同一設定となる事に気をつけてください。(訳注:最後の複数のサンプラはリスナの間違いでは?)
14.1 Default Configuration
14.1 デフォルト設定
The default items to be saved can be defined in the jmeter.properties (or user.properties) file. The properties are used as the initial settings for the Listener Config pop-up, and are also used for the log file specified by the -l command-line flag (commonly used for non-GUI test runs).
デフォルト設定はjmeter.properties (又は user.properties)ファイルに保存されて定義されています。プロパティはリスナの設定ポップアップの初期設定としても使用され、ログファイルに-lコマンドラインオプションでログ出力先ファイルを指定できます(通常non-GUIモードでのテスト実行で使用されます)。
To change the default format, find the following line in jmeter.properties:
デフォルト形式を変更するには、jmeter.propertiesの次の行を変更します:
jmeter.save.saveservice.output_format=
The information to be saved is configurable. For maximum information, choose "xml" as the format and specify "Functional Test Mode" on the Test Plan element. If this box is not checked, the default saved data includes a time stamp (the number of milliseconds since midnight, January 1, 1970 UTC), the data type, the thread name, the label, the response time, message, and code, and a success indicator. If checked, all information, including the full response data will be logged.
何を保存するかという情報はここで設定できます。最大値情報、"xml"形式で保存するか、テスト計画要素で"Functional Test Mode"を指定するか等が設定できます。このチェックボックスを有効にしない場合、デフォルトの設定が適用されます。デフォルトはタイムスタンプ(UTC 1970/01/01 00:00:00から現在時刻までのミリ秒単位の経過時間)、データタイプ、スレッド名、ラベル、レスポンス時間(訳注:save latencyのこと?)、メッセージ、ステータスコード、success indicator(訳注:Save Assertion Failure Message(アサーションの失敗メッセージじゃないの?)です。すべての項目をチェックした場合には応答データのすべての情報がログに出力されます。
The following example indicates how to set properties to get a vertical bar ("|") delimited format that will output results like:.
以下の例では縦棒("|")を区切子とした形式でプロパティを設定し、出力される例を示しています。
timeStamp|time|label|responseCode|threadName|dataType|success|failureMessage
02/06/03 08:21:42|1187|Home|200|Thread Group-1|text|true|
02/06/03 08:21:42|47|Login|200|Thread Group-1|text|false|Test Failed:
expected to contain: password etc.
The corresponding jmeter.properties that need to be set are shown below. One oddity in this example is that the output_format is set to csv, which typically indicates comma-separated values. However, the default_delimiter was set to be a vertical bar instead of a comma, so the csv tag is a misnomer in this case. (Think of CSV as meaning character separated values)
設定する必要があるjmeter.propertiesの項目は以下の通りです。この例で一つだけ特異な点はoutput_formatがcsvに設定されており、これは通常カンマ区切りを指示します。しかし、default_delimiterにはカンマではなく縦棒が指定されているため、この場合にはcsv区切りは異なったものとなります。(CSV形式を期待しているが、異なる区切子で分割されるため)
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.assertion_results_failure_message=true
jmeter.save.saveservice.default_delimiter=|
The full set of properties that affect result file output is shown below.
ファイル出力に影響を与えるプロパティの一式は以下の通りです。
#---------------------------------------------------------------------------
# Results file configuration
#---------------------------------------------------------------------------
# This section helps determine how result data will be saved.
# The commented out values are the defaults.
# legitimate values: xml, csv, db. Only xml and csv are currently supported.
#jmeter.save.saveservice.output_format=xml
# true when field should be saved; false otherwise
# assertion_results_failure_message only affects CSV output
#jmeter.save.saveservice.assertion_results_failure_message=false
#
#jmeter.save.saveservice.data_type=true
#jmeter.save.saveservice.label=true
#jmeter.save.saveservice.response_code=true
# response_data is not currently supported for CSV output
#jmeter.save.saveservice.response_data=false
# Save ResponseData for failed samples
#jmeter.save.saveservice.response_data.on_error=false
#jmeter.save.saveservice.response_message=true
#jmeter.save.saveservice.successful=true
#jmeter.save.saveservice.thread_name=true
#jmeter.save.saveservice.time=true
#jmeter.save.saveservice.subresults=true
#jmeter.save.saveservice.assertions=true
#jmeter.save.saveservice.latency=true
#jmeter.save.saveservice.samplerData=false
#jmeter.save.saveservice.responseHeaders=false
#jmeter.save.saveservice.requestHeaders=false
#jmeter.save.saveservice.encoding=false
#jmeter.save.saveservice.bytes=true
#jmeter.save.saveservice.url=false
#jmeter.save.saveservice.filename=false
#jmeter.save.saveservice.hostname=false
#jmeter.save.saveservice.thread_counts=false
#jmeter.save.saveservice.sample_count=false
# Timestamp format
# legitimate values: none, ms, or a format suitable for SimpleDateFormat
#jmeter.save.saveservice.timestamp_format=ms
#jmeter.save.saveservice.timestamp_format=MM/dd/yy HH:mm:ss
# Put the start time stamp in logs instead of the end
sampleresult.timestamp.start=true
# legitimate values: none, first, all
#jmeter.save.saveservice.assertion_results=none
# For use with Comma-separated value (CSV) files or other formats
# where the fields' values are separated by specified delimiters.
# Default:
#jmeter.save.saveservice.default_delimiter=,
# For TAB, since JMeter 2.3 one can use:
#jmeter.save.saveservice.default_delimiter=\t
#jmeter.save.saveservice.print_field_names=false
# Optional list of JMeter variable names whose values are to be saved in the result data files.
# Use commas to separate the names. For example:
#sample_variables=SESSION_ID,REFERENCE
# N.B. The current implementation saves the values in XML as attributes,
# so the names must be valid XML names.
# Optional xml processing instruction for line 2 of the file:
#jmeter.save.saveservice.xml_pi=<?xml-stylesheet type="text/xsl" href="sample.xsl"?>
The date format to be used for the timestamp_format is described in SimpleDateFormat . Bear in mind that choosing a date format other than "ms" is likely to make it impossible for JMeter to interpret the value when it is read in later for viewing purposes.
timestamp_formatで使用する日付形式はSimpleDateFormatで表されます。日付形式を選択する場合には、JMeterはプロパティを後から参照して時刻を確認するために割り込みを行うため"ミリ秒"以外を作成することは困難であることを覚えておいてください。
14.1.1 Sample Variables
14.1.1 サンプル変数
Versions of JMeter after 2.3.1 allow one to use the sample_variables property to define a list of additional JMeter variables which are to be saved with each sample in the JTL files. The values are written to CSV files as additional columns, and as additional attributes in XML files. See above for an example.
JMeter 2.3.1以降ではsample_variablesプロパティを定義して追加JMeter変数リストを定義しJTLファイルにそれぞれのサンプルを保存できます。値はCSVファイルとして、追加カラム、XMLファイルの追加属性が保存されます。後方の例を参照してください。
14.2 non-GUI (batch) test runs
14.2 non-GUI(バッチ)テストの実施
When running in non-GUI mode, the -l flag can be used to create a top-level listener for the test run. This is in addition to any Listeners defined in the test plan. The configuration of this listener is controlled by entries in the file jmeter.properties as described in the previous section.
non-GUIモードで実行する際に、-lオプションを使用してテスト実施時にトップレベルのリスナを使用できます。これはテスト計画で定義されたどのようなリスナでも追加します。このリスナはjmeter.propertiesファイルで完全に制御でき、直前のセクションで解説済みです。
This feature can be used to specify different data and log files for each test run, for example:
本機能は異なるデータとログファイルをそれぞれのテスト計画に指定できます。例:
jmeter -n -t testplan.jmx -l testplan_01.jtl -j testplan_01.log
jmeter -n -t testplan.jmx -l testplan_02.jtl -j testplan_02.log
Note that JMeter logging messages are written to the file jmeter.log by default. This file is recreated each time, so if you want to keep the log files for each run, you will need to rename it using the -j option as above. The -j option was added in version 2.3.
JMeterのログメッセージはデフォルトではjmeter.logファイルに出力される事に注意してください。このファイルは毎回作成され直されるため、実行する度のログファイルを保存するには、上記で示した通り-jオプションを使用してリネームする必要があります。-jオプションはversion 2.3から追加されました。
Versions of JMeter after 2.3.1 support variables in the log file name. If the filename contains paired single-quotes, then the name is processed as a SimpleDateFormat format applied to the current date, for example: log_file='jmeter_'yyyyMMddHHmmss'.tmp' . This can be used to generate a unique name for each test run.
JMeter Version 2.3.1以降ではログファイル名の変数をサポートしています。ファイル名に対となるシングルクォートが含まれる場合には、シングルクォートで囲まれない範囲はSimpleDateFormatとして処理され現在時刻が適用されます。例として、
log_file='jmeter_'yyyyMMddHHmmss'.tmp'が指定された場合には、テストを実行する度に重複の無いファイル名を生成します。
14.3 Resource usage
14.3 リソース使用量
Listeners can use a lot of memory if there are a lot of samples. Most of the listeners currently keep a copy of every sample they display, apart from:
大量のサンプルが存在するならリスナは大量のメモリを消費します。現状では多くのリスナは表示を行なうために全てのサンプルのコピーを保持しています。ただし、以下のものは保持しません。
* Simple Data Writer
* シンプルデータライタ
* BeanShell Listener
* BeanShellリスナ
* Assertion Results
* アサーション結果
* Mailer Visualizer
* メール表示機
* Monitor Results
* 観測結果
* Summary Report
* サマリ表示
To minimise the amount of memory needed, use the Simple Data Writer, and use the CSV format.
メモリ消費量を最小限に抑えるため、シンプルデータライタを使用してCSV形式で出力させましょう。
14.4 CSV Log format
14.4 CSVログフォーマット
The CSV log format depends on which data items are selected in the configuration. Only the specified data items are recorded in the file. The order of appearance of columns is fixed, and is as follows:
CSVログ形式は設定に置いてどのデータ項目が選択されたかに依存します。選択されたデータ項目だけがファイルに保存されます。カラムの出現順に出力し、以下に対応しています:
* timeStamp - in milliseconds since 1/1/1970
* タイムスタンプ - 1970/01/01 00:00:00からのミリ秒単位の経過時間
* elapsed - in milliseconds
* 経過時間 - ミリ秒単位
* label - sampler label
* ラベル - サンプラのラベル
* responseCode - e.g. 200, 404
* レスポンスコード - 例:200、404(訳注:むしろstatusCodeなんだけどなぁ。。。)
* responseMessage - e.g. OK(訳注:むしろreasonPhraseなんだけどなぁ。。。)
* レスポンスメッセージ -例:OK
* threadName
* スレッド名
* dataType - e.g. text
* データタイプ - 例 text
* success - true or false
* 結果 - 成功か失敗
* failureMessage - if any
* 失敗メッセージ - 存在するなら
* bytes - number of bytes in the sample
* バイト数 - サンプルのバイト数
* grpThreads - number of active threads in this thread group
* グループスレッド - スレッドグループ上でのスレッド番号
* allThreads - total number of active threads in all groups
* 総スレッド - 全てのスレッドグループのスレッドの総数
* URL
* URL
* Filename - if Save Response to File was used
* ファイル名 - 応答にファイル名が含まれているなら
* latency - time to first response
* レイテンシ - 初めの応答が返るまでの経過時間
* encoding
* エンコーディング
* SampleCount - number of samples (1, unless multiple samples are aggregated)
* サンプル数 - サンプル数(複数のサンプルが束ねられないなら1)
* ErrorCount - number of errors (0 or 1, unless multiple samples are aggregated)
* エラー数 - エラー数(複数のサンプルが束ねられないなら0か1)
* Hostname where the sample was generated
* ホスト名 - サンプルがどこで生成されたか(訳注:ハイフン抜けてる)
* Variables, if specified
* 変数 - 指定されているなら(訳注: ハイフンではなくカンマが指定されている)
14.5 XML Log format 2.0
14.5 XMLログ2.0形式
The format of the original XML (2.0) is as follows (line breaks will be different):
XML(2.0)のオリジナル形式は次の通りです(改行は異なるかもしれません):
<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
<sampleResult timeStamp="1144365463297" dataType="text" threadName="Listen 1-1"
label="HTTP Request" time="1502"
responseMessage="OK" responseCode="200" success="true">
<sampleResult timeStamp="1144365464238" dataType="text" threadName="Listen 1-1"
label="http://www.apache.org/style/style.css" time="171"
responseMessage="OK" responseCode="200" success="true">
<property xml:space="preserve" name="samplerData">
GET http://www.apache.org/style/style.css
</property>
<binary>
body, td, th {
font-size: 95%;
font-family: Arial, Geneva, Helvetica, sans-serif;
color: black;
background-color: white;
}
...
</binary>
</sampleResult>
</sampleResult>
...
</testResults>
14.6 XML Log format 2.1
14.6 XMLログ2.1形式
The format of the updated XML (2.1) is as follows (line breaks will be different):
アップデートされたXML(2.1)形式は以下の通りです(改行は異なるかもしれません):
<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
-- HTTP Sample, with nested samples
<httpSample t="1392" lt="351" ts="1144371014619" s="true"
lb="HTTP Request" rc="200" rm="OK"
tn="Listen 1-1" dt="text" de="iso-8859-1" by="12407">
<httpSample t="170" lt="170" ts="1144371015471" s="true"
lb="http://www.apache.org/style/style.css" rc="200" rm="OK"
tn="Listen 1-1" dt="text" de="ISO-8859-1" by="1002">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Date: Fri, 07 Apr 2006 00:50:14 GMT
...
Content-Type: text/css
</responseHeader>
<requestHeader class="java.lang.String">MyHeader: MyValue</requestHeader>
<responseData class="java.lang.String">body, td, th {
font-size: 95%;
font-family: Arial, Geneva, Helvetica, sans-serif;
color: black;
background-color: white;
}
...
</responseData>
<cookies class="java.lang.String"></cookies>
<method class="java.lang.String">GET</method>
<queryString class="java.lang.String"></queryString>
<url>http://www.apache.org/style/style.css</url>
</httpSample>
<httpSample t="200" lt="180" ts="1144371015641" s="true"
lb="http://www.apache.org/images/asf_logo_wide.gif"
rc="200" rm="OK" tn="Listen 1-1" dt="bin" de="ISO-8859-1" by="5866">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Date: Fri, 07 Apr 2006 00:50:14 GMT
...
Content-Type: image/gif
</responseHeader>
<requestHeader class="java.lang.String">MyHeader: MyValue</requestHeader>
<responseData class="java.lang.String">http://www.apache.org/asf.gif</responseData>
<responseFile class="java.lang.String">Mixed1.html</responseFile>
<cookies class="java.lang.String"></cookies>
<method class="java.lang.String">GET</method>
<queryString class="java.lang.String"></queryString>
<url>http://www.apache.org/asf.gif</url>
</httpSample>
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Date: Fri, 07 Apr 2006 00:50:13 GMT
...
Content-Type: text/html; charset=ISO-8859-1
</responseHeader>
<requestHeader class="java.lang.String">MyHeader: MyValue</requestHeader>
<responseData class="java.lang.String">
...
<html>
<head>
...
</head>
<body>
...
</body>
</html>
</responseData>
<cookies class="java.lang.String"></cookies>
<method class="java.lang.String">GET</method>
<queryString class="java.lang.String"></queryString>
<url>http://www.apache.org/</url>
</httpSample>
-- nonHTTPP Sample
<sample t="0" lt="0" ts="1144372616082" s="true" lb="Example Sampler"
rc="200" rm="OK" tn="Listen 1-1" dt="text" de="ISO-8859-1" by="10">
<responseHeader class="java.lang.String"></responseHeader>
<requestHeader class="java.lang.String"></requestHeader>
<responseData class="java.lang.String">Listen 1-1</responseData>
<responseFile class="java.lang.String">Mixed2.unknown</responseFile>
<samplerData class="java.lang.String">ssssss</samplerData>
</sample>
</testResults>
Note that the sample node name may be either "sample" or "httpSample".
14.7 Sample Attributes
14.7 サンプルの属性
The sample attributes have the following meaning:
サンプルの属性は以下のものがあります:
Attribute Content
属性 内容
by Bytes
by バイト数
de Data encoding
de データエンコーディング
dt Data type
dt データタイプ
ec Error count (0 or 1, unless multiple samples are aggregated)
ec エラー数(0か1、複数のサンプラが束ねられない場合)
hn Hostname where the sample was generated
hn サンプルを生成したホスト名
lb Label
lb ラベル(訳注:サンプラのラベルって書いてほしいなぁ)
lt Latency = time to initial response (milliseconds) - not all samplers support this
lt レイテンシ = 初回応答時間(ミリ秒) - 全てのサンプラではサポートされていません
na Number of active threads for all thread groups
na すべてのスレッドグループでのスレッド数
ng Number of active threads in this group
ng スレッドグループのスレッド数
rc Response Code (e.g. 200)
rc レスポンスコード(例:200)
rm Response Message (e.g. OK)
rm レスポンスメッセージ(例:OK)
s Success flag (true/false)
s 成功フラグ(true/false)
sc Sample count (1, unless multiple samples are aggregated)
sc サンプル数(1、サンプルが束ねられていない場合)
t Elapsed time (milliseconds)
t 経過時間(ミリ秒)
tn Thread Name
tn スレッド名
ts timeStamp (milliseconds since midnight Jan 1, 1970 UTC)
ts タイムスタンプ(UTC 1970/01/01 00:00:00からの経過時間のミリ秒)
varname Value of the named variable (versions of JMeter after 2.3.1)
varname 指定する変数の値(JMeter version 2.3.1以降でサポート)
Versions 2.1 and 2.1.1 of JMeter saved the Response Code as "rs", but read it back expecting to find "rc". This has been corrected so that it is always saved as "rc"; either "rc" or "rs" can be read.
Version 2.1 と 2.1.1 ではレスポンスコードは"rs"でしたが、"rc"を発見した場合には読み替えてください。これは既に修正済みで、"rs"と"rc"を読み込んだ場合には"rc"として保存されます。
Versions of JMeter after 2.3.1 allow additional variables to be saved with the test plan. Currently, the variables are saved as additional attributes. The testplan variable name is used as the attribute name.
JMeter version 2.3.1 以降では追加する変数をテスト計画に保存できます。現状では、変数はadditional属性と同様に保存されます。変数名testplanは属性名と同様に使用されます。
14.8 Saving response data
14.8 応答データの保存
As shown above, the response data can be saved in the XML log file if required. However, this can make the file rather large, and the text has to be encoded so that it is still valid XML. Also, images cannot be included.
Another solution is to use the Post-Processor Save_Responses_to_a_file . This generates a new file for each sample, and saves the file name with the sample. The file name can then be included in the sample log output. The data will be retrieved from the file if necessary when the sample log file is reloaded.
以前に示した通り、望むのであれば応答データをXMLログファイルに保存できます。しかしながら、ファイルサイズはかなり巨大になり、有効なXMLファイルであるためにテキストはエンコードされます。また、画像は含めることができません。
他には後処理のSave_Responses_to_a_fileを使用する方法もあります。これはそれぞれのサンプル毎にファイルを生成し、ファイル名はサンプルによって付けられます。ファイル名はサンプルのログに出力できます。データはサンプルのログファイルを再読み込みしてファイル名を検索して参照します。
14.9 Loading (reading) response data
14.9 応答データのロード(読み込み)
To view an existing results file, you can use the File "Browse..." button to select a file. If necessary, just create a dummy testplan with the appropriate Listener in it.
既存の結果ファイルを参照するには"参照..."ボタンを押下してファイルを選択します。必要があればダミーのテスト計画を作成して適切なリスナを設置します。
Results can be read from XML or CSV format files. When reading from CSV results files, the header (if present) is used to determine which fields were saved. In order to interpret a header-less CSV file correctly, the appropriate JMeter properties must be set.
XMLかCSV形式ファイルから結果を読み込みます。CSV結果ファイルを読み込む際、ヘッダ(存在するなら)によってどの項目が保存されたかを判定できます。ヘッダの存在しないCSVファイルを性格に解析するため、適切なJMeterプロパティが接待されているべきです。
というわけで次は14章。18章まであと少し(ひぃ
14. Introduction to listeners
14. リスナの手引き
A listener is a component that shows the results of the samples. The results can be shown in a tree, tables, graphs or simply written to a log file. To view the contents of a response from any given sampler, add either of the Listeners "View Results Tree" or "View Results in table" to a test plan. To view the response time graphically, add graph results, spline results or distribution graph. The listeners section of the components page has full descriptions of all the listeners.
リスナはサンプルの結果を表示する構成要素です。結果はツリーと表とグラフへの表示、単純にログファイルへの出力に対応しています。複数のサンプルから与えられた応答の内容を見るには、"ツリーで結果を参照"か"表形式で結果を参照"のどちらかのリスナをテスト計画に追加します。応答時間をグラフで表示するにはグラフ結果を追加し、スプライン曲線がグラフに表示されるでしょう(訳注:ここものすごく超訳)。リスナ(訳注:Aタグ注意)セクションには全てのリスナに対する完全な解説が記されています。
Different listeners display the response information in different ways. However, they all write the same raw data to the output file - if one is specified.
それぞれのリスナは異なる方法で応答の情報を表示します。その一方、指定されていれば、リスナは同一のRAWデータをファイルに出力します。
The "Configure" button can be used to specify which fields to write to the file, and whether to write it as CSV or XML. CSV files are much smaller than XML files, so use CSV if you are generating lots of samples.
"設定"ボタンによってファイルに出力する項目の決定と、CSVかXML形式どちらで書き込むかを指定できます。CSVファイルはXMLファイルよりサイズが小さいため、CSVではより多くのサンプルを保存できます。
If you only wish to record certain samples, add the Listener as a child of the sampler. Or you can use a Simple Controller to group a set of samplers, and add the Listener to that. The same filename can be used by multiple samplers - but make sure they all use the same configuration!
特定のサンプルの保存だけを行ないたい場合には、該当するサンプラの子要素としてリスナを追加してください。もしくは、サンプラのグループにシンプルコントローラを使用し、リスナをコントローラの子要素として追加します。複数のサンプラに同一のファイル名を指定できます。しかし、同一設定となる事に気をつけてください。(訳注:最後の複数のサンプラはリスナの間違いでは?)
14.1 Default Configuration
14.1 デフォルト設定
The default items to be saved can be defined in the jmeter.properties (or user.properties) file. The properties are used as the initial settings for the Listener Config pop-up, and are also used for the log file specified by the -l command-line flag (commonly used for non-GUI test runs).
デフォルト設定はjmeter.properties (又は user.properties)ファイルに保存されて定義されています。プロパティはリスナの設定ポップアップの初期設定としても使用され、ログファイルに-lコマンドラインオプションでログ出力先ファイルを指定できます(通常non-GUIモードでのテスト実行で使用されます)。
To change the default format, find the following line in jmeter.properties:
デフォルト形式を変更するには、jmeter.propertiesの次の行を変更します:
jmeter.save.saveservice.output_format=
The information to be saved is configurable. For maximum information, choose "xml" as the format and specify "Functional Test Mode" on the Test Plan element. If this box is not checked, the default saved data includes a time stamp (the number of milliseconds since midnight, January 1, 1970 UTC), the data type, the thread name, the label, the response time, message, and code, and a success indicator. If checked, all information, including the full response data will be logged.
何を保存するかという情報はここで設定できます。最大値情報、"xml"形式で保存するか、テスト計画要素で"Functional Test Mode"を指定するか等が設定できます。このチェックボックスを有効にしない場合、デフォルトの設定が適用されます。デフォルトはタイムスタンプ(UTC 1970/01/01 00:00:00から現在時刻までのミリ秒単位の経過時間)、データタイプ、スレッド名、ラベル、レスポンス時間(訳注:save latencyのこと?)、メッセージ、ステータスコード、success indicator(訳注:Save Assertion Failure Message(アサーションの失敗メッセージじゃないの?)です。すべての項目をチェックした場合には応答データのすべての情報がログに出力されます。
The following example indicates how to set properties to get a vertical bar ("|") delimited format that will output results like:.
以下の例では縦棒("|")を区切子とした形式でプロパティを設定し、出力される例を示しています。
timeStamp|time|label|responseCode|threadName|dataType|success|failureMessage
02/06/03 08:21:42|1187|Home|200|Thread Group-1|text|true|
02/06/03 08:21:42|47|Login|200|Thread Group-1|text|false|Test Failed:
expected to contain: password etc.
The corresponding jmeter.properties that need to be set are shown below. One oddity in this example is that the output_format is set to csv, which typically indicates comma-separated values. However, the default_delimiter was set to be a vertical bar instead of a comma, so the csv tag is a misnomer in this case. (Think of CSV as meaning character separated values)
設定する必要があるjmeter.propertiesの項目は以下の通りです。この例で一つだけ特異な点はoutput_formatがcsvに設定されており、これは通常カンマ区切りを指示します。しかし、default_delimiterにはカンマではなく縦棒が指定されているため、この場合にはcsv区切りは異なったものとなります。(CSV形式を期待しているが、異なる区切子で分割されるため)
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.assertion_results_failure_message=true
jmeter.save.saveservice.default_delimiter=|
The full set of properties that affect result file output is shown below.
ファイル出力に影響を与えるプロパティの一式は以下の通りです。
#---------------------------------------------------------------------------
# Results file configuration
#---------------------------------------------------------------------------
# This section helps determine how result data will be saved.
# The commented out values are the defaults.
# legitimate values: xml, csv, db. Only xml and csv are currently supported.
#jmeter.save.saveservice.output_format=xml
# true when field should be saved; false otherwise
# assertion_results_failure_message only affects CSV output
#jmeter.save.saveservice.assertion_results_failure_message=false
#
#jmeter.save.saveservice.data_type=true
#jmeter.save.saveservice.label=true
#jmeter.save.saveservice.response_code=true
# response_data is not currently supported for CSV output
#jmeter.save.saveservice.response_data=false
# Save ResponseData for failed samples
#jmeter.save.saveservice.response_data.on_error=false
#jmeter.save.saveservice.response_message=true
#jmeter.save.saveservice.successful=true
#jmeter.save.saveservice.thread_name=true
#jmeter.save.saveservice.time=true
#jmeter.save.saveservice.subresults=true
#jmeter.save.saveservice.assertions=true
#jmeter.save.saveservice.latency=true
#jmeter.save.saveservice.samplerData=false
#jmeter.save.saveservice.responseHeaders=false
#jmeter.save.saveservice.requestHeaders=false
#jmeter.save.saveservice.encoding=false
#jmeter.save.saveservice.bytes=true
#jmeter.save.saveservice.url=false
#jmeter.save.saveservice.filename=false
#jmeter.save.saveservice.hostname=false
#jmeter.save.saveservice.thread_counts=false
#jmeter.save.saveservice.sample_count=false
# Timestamp format
# legitimate values: none, ms, or a format suitable for SimpleDateFormat
#jmeter.save.saveservice.timestamp_format=ms
#jmeter.save.saveservice.timestamp_format=MM/dd/yy HH:mm:ss
# Put the start time stamp in logs instead of the end
sampleresult.timestamp.start=true
# legitimate values: none, first, all
#jmeter.save.saveservice.assertion_results=none
# For use with Comma-separated value (CSV) files or other formats
# where the fields' values are separated by specified delimiters.
# Default:
#jmeter.save.saveservice.default_delimiter=,
# For TAB, since JMeter 2.3 one can use:
#jmeter.save.saveservice.default_delimiter=\t
#jmeter.save.saveservice.print_field_names=false
# Optional list of JMeter variable names whose values are to be saved in the result data files.
# Use commas to separate the names. For example:
#sample_variables=SESSION_ID,REFERENCE
# N.B. The current implementation saves the values in XML as attributes,
# so the names must be valid XML names.
# Optional xml processing instruction for line 2 of the file:
#jmeter.save.saveservice.xml_pi=<?xml-stylesheet type="text/xsl" href="sample.xsl"?>
The date format to be used for the timestamp_format is described in SimpleDateFormat . Bear in mind that choosing a date format other than "ms" is likely to make it impossible for JMeter to interpret the value when it is read in later for viewing purposes.
timestamp_formatで使用する日付形式はSimpleDateFormatで表されます。日付形式を選択する場合には、JMeterはプロパティを後から参照して時刻を確認するために割り込みを行うため"ミリ秒"以外を作成することは困難であることを覚えておいてください。
14.1.1 Sample Variables
14.1.1 サンプル変数
Versions of JMeter after 2.3.1 allow one to use the sample_variables property to define a list of additional JMeter variables which are to be saved with each sample in the JTL files. The values are written to CSV files as additional columns, and as additional attributes in XML files. See above for an example.
JMeter 2.3.1以降ではsample_variablesプロパティを定義して追加JMeter変数リストを定義しJTLファイルにそれぞれのサンプルを保存できます。値はCSVファイルとして、追加カラム、XMLファイルの追加属性が保存されます。後方の例を参照してください。
14.2 non-GUI (batch) test runs
14.2 non-GUI(バッチ)テストの実施
When running in non-GUI mode, the -l flag can be used to create a top-level listener for the test run. This is in addition to any Listeners defined in the test plan. The configuration of this listener is controlled by entries in the file jmeter.properties as described in the previous section.
non-GUIモードで実行する際に、-lオプションを使用してテスト実施時にトップレベルのリスナを使用できます。これはテスト計画で定義されたどのようなリスナでも追加します。このリスナはjmeter.propertiesファイルで完全に制御でき、直前のセクションで解説済みです。
This feature can be used to specify different data and log files for each test run, for example:
本機能は異なるデータとログファイルをそれぞれのテスト計画に指定できます。例:
jmeter -n -t testplan.jmx -l testplan_01.jtl -j testplan_01.log
jmeter -n -t testplan.jmx -l testplan_02.jtl -j testplan_02.log
Note that JMeter logging messages are written to the file jmeter.log by default. This file is recreated each time, so if you want to keep the log files for each run, you will need to rename it using the -j option as above. The -j option was added in version 2.3.
JMeterのログメッセージはデフォルトではjmeter.logファイルに出力される事に注意してください。このファイルは毎回作成され直されるため、実行する度のログファイルを保存するには、上記で示した通り-jオプションを使用してリネームする必要があります。-jオプションはversion 2.3から追加されました。
Versions of JMeter after 2.3.1 support variables in the log file name. If the filename contains paired single-quotes, then the name is processed as a SimpleDateFormat format applied to the current date, for example: log_file='jmeter_'yyyyMMddHHmmss'.tmp' . This can be used to generate a unique name for each test run.
JMeter Version 2.3.1以降ではログファイル名の変数をサポートしています。ファイル名に対となるシングルクォートが含まれる場合には、シングルクォートで囲まれない範囲はSimpleDateFormatとして処理され現在時刻が適用されます。例として、
log_file='jmeter_'yyyyMMddHHmmss'.tmp'が指定された場合には、テストを実行する度に重複の無いファイル名を生成します。
14.3 Resource usage
14.3 リソース使用量
Listeners can use a lot of memory if there are a lot of samples. Most of the listeners currently keep a copy of every sample they display, apart from:
大量のサンプルが存在するならリスナは大量のメモリを消費します。現状では多くのリスナは表示を行なうために全てのサンプルのコピーを保持しています。ただし、以下のものは保持しません。
* Simple Data Writer
* シンプルデータライタ
* BeanShell Listener
* BeanShellリスナ
* Assertion Results
* アサーション結果
* Mailer Visualizer
* メール表示機
* Monitor Results
* 観測結果
* Summary Report
* サマリ表示
To minimise the amount of memory needed, use the Simple Data Writer, and use the CSV format.
メモリ消費量を最小限に抑えるため、シンプルデータライタを使用してCSV形式で出力させましょう。
14.4 CSV Log format
14.4 CSVログフォーマット
The CSV log format depends on which data items are selected in the configuration. Only the specified data items are recorded in the file. The order of appearance of columns is fixed, and is as follows:
CSVログ形式は設定に置いてどのデータ項目が選択されたかに依存します。選択されたデータ項目だけがファイルに保存されます。カラムの出現順に出力し、以下に対応しています:
* timeStamp - in milliseconds since 1/1/1970
* タイムスタンプ - 1970/01/01 00:00:00からのミリ秒単位の経過時間
* elapsed - in milliseconds
* 経過時間 - ミリ秒単位
* label - sampler label
* ラベル - サンプラのラベル
* responseCode - e.g. 200, 404
* レスポンスコード - 例:200、404(訳注:むしろstatusCodeなんだけどなぁ。。。)
* responseMessage - e.g. OK(訳注:むしろreasonPhraseなんだけどなぁ。。。)
* レスポンスメッセージ -例:OK
* threadName
* スレッド名
* dataType - e.g. text
* データタイプ - 例 text
* success - true or false
* 結果 - 成功か失敗
* failureMessage - if any
* 失敗メッセージ - 存在するなら
* bytes - number of bytes in the sample
* バイト数 - サンプルのバイト数
* grpThreads - number of active threads in this thread group
* グループスレッド - スレッドグループ上でのスレッド番号
* allThreads - total number of active threads in all groups
* 総スレッド - 全てのスレッドグループのスレッドの総数
* URL
* URL
* Filename - if Save Response to File was used
* ファイル名 - 応答にファイル名が含まれているなら
* latency - time to first response
* レイテンシ - 初めの応答が返るまでの経過時間
* encoding
* エンコーディング
* SampleCount - number of samples (1, unless multiple samples are aggregated)
* サンプル数 - サンプル数(複数のサンプルが束ねられないなら1)
* ErrorCount - number of errors (0 or 1, unless multiple samples are aggregated)
* エラー数 - エラー数(複数のサンプルが束ねられないなら0か1)
* Hostname where the sample was generated
* ホスト名 - サンプルがどこで生成されたか(訳注:ハイフン抜けてる)
* Variables, if specified
* 変数 - 指定されているなら(訳注: ハイフンではなくカンマが指定されている)
14.5 XML Log format 2.0
14.5 XMLログ2.0形式
The format of the original XML (2.0) is as follows (line breaks will be different):
XML(2.0)のオリジナル形式は次の通りです(改行は異なるかもしれません):
<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
<sampleResult timeStamp="1144365463297" dataType="text" threadName="Listen 1-1"
label="HTTP Request" time="1502"
responseMessage="OK" responseCode="200" success="true">
<sampleResult timeStamp="1144365464238" dataType="text" threadName="Listen 1-1"
label="http://www.apache.org/style/style.css" time="171"
responseMessage="OK" responseCode="200" success="true">
<property xml:space="preserve" name="samplerData">
GET http://www.apache.org/style/style.css
</property>
<binary>
body, td, th {
font-size: 95%;
font-family: Arial, Geneva, Helvetica, sans-serif;
color: black;
background-color: white;
}
...
</binary>
</sampleResult>
</sampleResult>
...
</testResults>
14.6 XML Log format 2.1
14.6 XMLログ2.1形式
The format of the updated XML (2.1) is as follows (line breaks will be different):
アップデートされたXML(2.1)形式は以下の通りです(改行は異なるかもしれません):
<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
-- HTTP Sample, with nested samples
<httpSample t="1392" lt="351" ts="1144371014619" s="true"
lb="HTTP Request" rc="200" rm="OK"
tn="Listen 1-1" dt="text" de="iso-8859-1" by="12407">
<httpSample t="170" lt="170" ts="1144371015471" s="true"
lb="http://www.apache.org/style/style.css" rc="200" rm="OK"
tn="Listen 1-1" dt="text" de="ISO-8859-1" by="1002">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Date: Fri, 07 Apr 2006 00:50:14 GMT
...
Content-Type: text/css
</responseHeader>
<requestHeader class="java.lang.String">MyHeader: MyValue</requestHeader>
<responseData class="java.lang.String">body, td, th {
font-size: 95%;
font-family: Arial, Geneva, Helvetica, sans-serif;
color: black;
background-color: white;
}
...
</responseData>
<cookies class="java.lang.String"></cookies>
<method class="java.lang.String">GET</method>
<queryString class="java.lang.String"></queryString>
<url>http://www.apache.org/style/style.css</url>
</httpSample>
<httpSample t="200" lt="180" ts="1144371015641" s="true"
lb="http://www.apache.org/images/asf_logo_wide.gif"
rc="200" rm="OK" tn="Listen 1-1" dt="bin" de="ISO-8859-1" by="5866">
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Date: Fri, 07 Apr 2006 00:50:14 GMT
...
Content-Type: image/gif
</responseHeader>
<requestHeader class="java.lang.String">MyHeader: MyValue</requestHeader>
<responseData class="java.lang.String">http://www.apache.org/asf.gif</responseData>
<responseFile class="java.lang.String">Mixed1.html</responseFile>
<cookies class="java.lang.String"></cookies>
<method class="java.lang.String">GET</method>
<queryString class="java.lang.String"></queryString>
<url>http://www.apache.org/asf.gif</url>
</httpSample>
<responseHeader class="java.lang.String">HTTP/1.1 200 OK
Date: Fri, 07 Apr 2006 00:50:13 GMT
...
Content-Type: text/html; charset=ISO-8859-1
</responseHeader>
<requestHeader class="java.lang.String">MyHeader: MyValue</requestHeader>
<responseData class="java.lang.String">
...
<html>
<head>
...
</head>
<body>
...
</body>
</html>
</responseData>
<cookies class="java.lang.String"></cookies>
<method class="java.lang.String">GET</method>
<queryString class="java.lang.String"></queryString>
<url>http://www.apache.org/</url>
</httpSample>
-- nonHTTPP Sample
<sample t="0" lt="0" ts="1144372616082" s="true" lb="Example Sampler"
rc="200" rm="OK" tn="Listen 1-1" dt="text" de="ISO-8859-1" by="10">
<responseHeader class="java.lang.String"></responseHeader>
<requestHeader class="java.lang.String"></requestHeader>
<responseData class="java.lang.String">Listen 1-1</responseData>
<responseFile class="java.lang.String">Mixed2.unknown</responseFile>
<samplerData class="java.lang.String">ssssss</samplerData>
</sample>
</testResults>
Note that the sample node name may be either "sample" or "httpSample".
14.7 Sample Attributes
14.7 サンプルの属性
The sample attributes have the following meaning:
サンプルの属性は以下のものがあります:
Attribute Content
属性 内容
by Bytes
by バイト数
de Data encoding
de データエンコーディング
dt Data type
dt データタイプ
ec Error count (0 or 1, unless multiple samples are aggregated)
ec エラー数(0か1、複数のサンプラが束ねられない場合)
hn Hostname where the sample was generated
hn サンプルを生成したホスト名
lb Label
lb ラベル(訳注:サンプラのラベルって書いてほしいなぁ)
lt Latency = time to initial response (milliseconds) - not all samplers support this
lt レイテンシ = 初回応答時間(ミリ秒) - 全てのサンプラではサポートされていません
na Number of active threads for all thread groups
na すべてのスレッドグループでのスレッド数
ng Number of active threads in this group
ng スレッドグループのスレッド数
rc Response Code (e.g. 200)
rc レスポンスコード(例:200)
rm Response Message (e.g. OK)
rm レスポンスメッセージ(例:OK)
s Success flag (true/false)
s 成功フラグ(true/false)
sc Sample count (1, unless multiple samples are aggregated)
sc サンプル数(1、サンプルが束ねられていない場合)
t Elapsed time (milliseconds)
t 経過時間(ミリ秒)
tn Thread Name
tn スレッド名
ts timeStamp (milliseconds since midnight Jan 1, 1970 UTC)
ts タイムスタンプ(UTC 1970/01/01 00:00:00からの経過時間のミリ秒)
varname Value of the named variable (versions of JMeter after 2.3.1)
varname 指定する変数の値(JMeter version 2.3.1以降でサポート)
Versions 2.1 and 2.1.1 of JMeter saved the Response Code as "rs", but read it back expecting to find "rc". This has been corrected so that it is always saved as "rc"; either "rc" or "rs" can be read.
Version 2.1 と 2.1.1 ではレスポンスコードは"rs"でしたが、"rc"を発見した場合には読み替えてください。これは既に修正済みで、"rs"と"rc"を読み込んだ場合には"rc"として保存されます。
Versions of JMeter after 2.3.1 allow additional variables to be saved with the test plan. Currently, the variables are saved as additional attributes. The testplan variable name is used as the attribute name.
JMeter version 2.3.1 以降では追加する変数をテスト計画に保存できます。現状では、変数はadditional属性と同様に保存されます。変数名testplanは属性名と同様に使用されます。
14.8 Saving response data
14.8 応答データの保存
As shown above, the response data can be saved in the XML log file if required. However, this can make the file rather large, and the text has to be encoded so that it is still valid XML. Also, images cannot be included.
Another solution is to use the Post-Processor Save_Responses_to_a_file . This generates a new file for each sample, and saves the file name with the sample. The file name can then be included in the sample log output. The data will be retrieved from the file if necessary when the sample log file is reloaded.
以前に示した通り、望むのであれば応答データをXMLログファイルに保存できます。しかしながら、ファイルサイズはかなり巨大になり、有効なXMLファイルであるためにテキストはエンコードされます。また、画像は含めることができません。
他には後処理のSave_Responses_to_a_fileを使用する方法もあります。これはそれぞれのサンプル毎にファイルを生成し、ファイル名はサンプルによって付けられます。ファイル名はサンプルのログに出力できます。データはサンプルのログファイルを再読み込みしてファイル名を検索して参照します。
14.9 Loading (reading) response data
14.9 応答データのロード(読み込み)
To view an existing results file, you can use the File "Browse..." button to select a file. If necessary, just create a dummy testplan with the appropriate Listener in it.
既存の結果ファイルを参照するには"参照..."ボタンを押下してファイルを選択します。必要があればダミーのテスト計画を作成して適切なリスナを設置します。
Results can be read from XML or CSV format files. When reading from CSV results files, the header (if present) is used to determine which fields were saved. In order to interpret a header-less CSV file correctly, the appropriate JMeter properties must be set.
XMLかCSV形式ファイルから結果を読み込みます。CSV結果ファイルを読み込む際、ヘッダ(存在するなら)によってどの項目が保存されたかを判定できます。ヘッダの存在しないCSVファイルを性格に解析するため、適切なJMeterプロパティが接待されているべきです。
英語勉強日記#8(翻訳がんばろう日記) More ログイン