Previous: Brick in Deamon ModeUp: Brick User GuideNext: Script Files

Addanc Reference Manual
Addanc User Guide

Addanc HomeIndexTable of Contents

Brick User Guide


Brick Configuration Files

The behavior of the brick can be controlled by setting values in two files. The first file, the Brick Configuration File,  contains a XML described set of brick behavior and configuration settings. The second file, the Brick Logging Configuration File, contains information controlling the behavior of the python logging system used for Addanc logging. The logging is mostly useful for tracing the behavior of the Addanc Brick during development. When used for production level testing, the logging should be configured to report only errors.

Brick Configuration File

The Brick Configuration File (BCF) is an XML based configuration file with two basic entities, <appSettings> and  <recorders>, which are themselves contained in a <configuration> entity. Brick configuration settings are stored in the <appSettings> entity and instrumentation recorders are defined in <recorders> entity.

<appSettings> Entity

 Brick configuration settings are stored in the <appSettings> entity as <add> nodes. Each configurable parameter can be assigned a value in the <add> node with the parameter name serving as the key.

Note: The settings entered at the command line will override the values defined in the BCF.

The path to the BCF can be specified by the --config command line option. If a BCF is not specified on the command line, the default path/filename is "addanc.config".

The following <add> node configuration parameters may be set in the <appSettings> entity of the the BCF:


Key/ParameterName Type Value/Setting

daemon Boolean
Set to "True" to enable starting the brick in daemon mode.

pidfile String Set the path/filename for the PID file. The AddancBrickwrites the value of the detached process' current PID to this file when started in daemon mode. If no value is set in the BCF, this parameter defaults to 'addanc.brick.pid.'

jid String Set the jabber ID to be used by the Brick when running in daemon mode and receiving commands from the AddancCommander. The jabber ID should include both the brick's jabber name and the Fully Qualified Domain name of your jabber server; e.g., addanc_brick@myjabber.mydomain.com.

jabberpassword String Set the password to be used for authorizing the specified jabber ID.

commanderjid String Set the jabberID for the AddancCommander to be used when running in daemon mode. The jabber ID should include both the commander's jabber name and the Fully Qualified Domain name of your jabber server; e.g., addanc_commander@myjabber.mydomain.com.

resource_name String Set the BrickID for this instance of the brick. This is the name used by the AddancCommander to display information from this brick and to send commands back to this brick.

logconfigfile String Set the path/filename for Brick Logging Configuration File. If no value is set in the BCF, this parameter defaults to 'addanc.log.config.'

instumentationfile String Set the path/filename for instrumentation/measurements file. If no value is set in the BCF, this parameter defaults to 'addanc.brick.instrumentation.' [IGNORED]

enable_heartbeat Boolean
Set to "True" to enable heartbeat messages to the log(s) and the AddancCommander.

heartbeatrate Float Specify the heartbeat rate, in seconds. The heartbeat rate is the delay between sending status messages to the log(s) and the AddancCommander.

connectthreadcount Integer Specify the number of threads created and dedicated to making connections for the virtual clients. This may loosly be defined as a connection pool limit. For more information on the connection pool, see the section on Brick Architecture in the Tech Specs section of this document.
vc_inventory_level Integer Specify the minimum number of VCs to maintain when creating new VCs. This number should not be too large, but large enough that new VCs are available when needed to meet the testing arrival rate.
max_new_vc_queue_depth Integer Specify the number of VC that have been started to satisfy the testing arrival rate but have not yet started running. This queue depth should be relatively low, if it grows too large, that is typically an indicator that there is some internal failure in the Addanc Brick. Setting this number to a realistic value will cause Addanc to raise an exception if the queue grows beyond that setting.
max_run_queue_depth Integer Specify the size of the Addanc Run Queue in terms of number of concurrent VCs. This should normally be set to 0 so that no size limit is enforced. For more information on the Addanc Run Queue,  see the section on Brick Architecture in the Tech Specs section of this document.
max_process_queue_depth Integer Specify the size of the Addanc Process Queue in terms of number of concurrent VCs. This should normally be set to 0 so that no size limit is enforced. For more information on the Addanc Process Queue,  see the section on Brick Architecture in the Tech Specs section of this document.
max_wait_queue_depth Integer Specify the size of the Addanc Wait Queue in terms of number of concurrent VCs. This should normally be set to 0 so that no size limit is enforced. For more information on the Addanc Wait Queue,  see the section on Brick Architecture in the Tech Specs section of this document.

Notes:
  1. Boolean Type values will be set to True when value is one of  'True', 'true', 'TRUE', '1', 'On', 'on', 'ON', 'Yes' , 'yes', 'YES'. Any other value will be interpreted as False.
  2. Even when value types are Boolean, integer, or float, the setting must be enclosed in quotes in the <add key="parameterName" value="Setting" /> entry.
 

<recorders> Entity

Instrumentation data collected by the Addanc VCs is passed to all defined recorders for transfer to permanent storage. Instrumentation recorders are defined in the <recorders> section. Addanc recognizes two recorders, a file recorder and a database recorder. The file recorder writes the instrumentation data in comma delimited format to a flat file. The database recorder stored the instrumentation data in a MySQL database.

The file recorder is enabled by including the <fileRecorder> entity in the <recorders> entity. The filename may be specified using the filename tag. An example of a properly formatted entry.

<fileRecorder filename="addanc.brick.instrumentation">fileRecorder</fileRecorder>

Note: The fileRecorder value between the start and end tags is important. Addanc will look for a python module with a name matching the specified value. The Addanc installation process will install the default file module as fileRecorder .

The database recorder is enabled by including the <mySQLRecorder> entity in the <recorders> entity. The tags in the <mySQLRecorder> entity are used to define the connection parameters for the MySQL database connection. 

Key Name Value/Setting
host Specify the location (hostname or IP) of the MySQL server.
database Specify the database name used for recording the instrumentation data. This value defaults to addanc in the default installation files.
userid Specify a MySQL user id that has insert access to the database specified using the database key.
password Specify the password associated with MySQL user selected in the userid key.

A properly formatted <mySQLRecorder> entity looks like:

      <mySQLRecorder host="127.0.0.1" database="addanc" userid="addancbrick" password="dragonbrick">
             mySQLRecorder
      </mySQLRecorder>

Note: The mySQLRecorder value between the start and end tags is important. Addanc will look for a python module with a name matching the specified value. The Addanc installation process will install the default database module as mySQLRecorder.

Brick Configuration File Example

The BCF included in the basic source distribution resembles:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
        <!-- These settings can be overridden by the CLI -->
        <add key="daemon" value="False" />
        <add key="pidfile" value="addanc.brick.pid" />
        <add key="jid" value="brick0@myjabber.mydomain.com" />
        <add key="jabberpassword" value="xxx" />
        <add key="commanderjid" value="addanc_commander@myjabber.mydomain.com" />
        <add key="resource_name" value="brick00" />
        <add key="logconfigfile" value="addanc.log.config" />
        <add key="enable_heartbeat" value="Yes" />
        <add key="heartbeatrate" value="2.0" />
        <!-- Non-command line configuration option(s), DO NOT DELETE any of the following lines -->
        <add key="connectthreadcount" value="6" />
        <add key="vc_inventory_level" value="4" />
        <add key="max_new_vc_queue_depth" value="100" />
        <add key="max_run_queue_depth" value="0" />
        <add key="max_process_queue_depth" value="0" />
        <add key="max_wait_queue_depth" value="0" />
  </appSettings>

  <recorders>
     <fileRecorder filename="addanc.brick.instrumentation">fileRecorder</fileRecorder>
      <!-- Remove comment(s) to enable MySQL support, set tags to to local values
      <mySQLRecorder host="127.0.0.1" database="addanc" userid="addancbrick" password="dragonbrick">
             mySQLRecorder
      </mySQLRecorder>
      -->
    </recorders>
</configuration>

Brick Logging Configuration File

The Brick Logging Configuration File (BLCF)  contains settings to control the behavior of the brick logging system.

The setting parameters conform to the Python 2.3 logging component documentation. Check the Python 2.3 documentation for more information on defining logging handlers and formats.

Each identified AddancBrick component can be configured to report messages of level DEBUG, INFO, WARNING, ERROR, CRITICAL, or EXCEPTION.

The basic BLCF defines three logging devices, the console, a disk log file, and a raw HTML log file. The level of messages reported to each logging device can be set independently to any of the report level values. When using the Addanc Brick, optimal performance can be obtained by setting the logging level to CRITICAL for all loggers. 

HTML Logging

Often, when testing scripts, it can be valuable to examine the raw HTML associated with a transactions. The Addanc Brick defines two logging objects, rawHTMLsend and rawHTMLrecv, that receive copies of the raw byte stream during send and receive operations. The log messages are generated at the INFO level, so setting the level value for the [logger_rawHTMLsend] and/or [logger_rawHTMLrecv] entries to WARNING or above will suppress the generation of the HTML log. This log can grow quite rapidly if the test involves a high transaction rate, it should probably be enables on while testing and developing script files.

Brick Logging Configuration File Example

The BLCF in the basic source distribution resembles:

[loggers]
keys=root,configload,brickControlThread,initJabberThread,txngenerator,waitqprocessor,instrumentation_recorder,vcfactory,signalgenerator,txnprocessor,virtual_client,vcscript,vctest,rawHTMLsend,rawHTMLrecv

[handlers]
keys=console,diskfile,diskfileHTMLlog

[formatters]
keys=terseformat,verboseformat

[logger_root]
level=WARNING
handlers=console,diskfile

[logger_configload]
level=WARNING
handlers=console,diskfile
propagate=0
qualname=addanc.config._loadAppSettings

[logger_rawHTMLsend]
level=ERROR
handlers=diskfileHTMLlog
propagate=0
qualname=addanc.rawHTMLsend

[logger_rawHTMLrecv]
level=ERROR
handlers=diskfileHTMLlog
propagate=0
qualname=addanc.rawHTMLrecv

[logger_brickControlThread]
level=WARNING

handlers=console,diskfile
propagate=0
qualname=addanc.brick.brickControlThread

[logger_initJabberThread]
level=WARNING
handlers=console,diskfile
propagate=0
qualname=addanc.brick.initializeJabberThread

[logger_txngenerator]
level=WARNING
handlers=console,diskfile
propagate=0
qualname=addanc.brick.txngenerator

[logger_waitqprocessor]
level=WARNING
handlers=console,diskfile
propagate=0
qualname=addanc.brick.waitqprocessor

[logger_instrumentation_recorder]
level=WARNING
handlers=console,diskfile
propagate=0
qualname=addanc.brick.instrumentation_recorder

[logger_vcfactory]
level=WARNING
handlers=console,diskfile
propagate=0
qualname=addanc.brick.vcfactory

[logger_signalgenerator]
level=WARNING
handlers=console,diskfile
propagate=0
qualname=addanc.brick.signalgenerator

[logger_txnprocessor]
level=WARNING
handlers=console,diskfile
propagate=0
qualname=addanc.brick.txnprocessor

[logger_virtual_client]
level=WARNING
handlers=console,diskfile
propagate=0
qualname=addanc.brick.virtual_client

[logger_vcscript]
level=WARNING
handlers=console,diskfile
propagate=0
qualname=addanc.brick.vcscript

[logger_vctest]
level=WARNING
handlers=console,diskfile
propagate=0
qualname=addanc.brick.vctest

[handler_console]
class=StreamHandler
level=CRITICAL
formatter=terseformat
args=(sys.stdout,)

[handler_diskfile]
class=FileHandler
level=WARNING
formatter=verboseformat
args=(DEFAULT_LOG_FILENAME, 'w')

[handler_diskfileHTMLlog]
class=FileHandler
level=ERROR
formatter=verboseformat
args=('addanc.brick.html.log', 'w')

[formatter_terseformat]
format=%(asctime)s %(levelname)s:%(name)s:%(message)s

[formatter_verboseformat]
format=%(asctime)s [%(process)d:%(thread)d] %(levelname)s:%(name)s:%(message)s

 


Previous: Brick in Daemon Mode Up: Brick User Guide Next: Script Files
Page Updated: 02/10/2004