configVariablesLoad {WebAnalytics}R Documentation

Read a configuration file and store the variables

Description

These are functions to read, validate and execute a report configuration file placing its output as a series of variables in a hidden scope; they also access and check existence of the variables. Variables whose names begin 'config.' will be printed at load time along with their values.

Usage

configVariablesLoad(fileName="report.config")
configVariableGet(name)
configVariableIs(name)
configVariablesAll()
configVariableSet(name, value)

Arguments

fileName

The name of the configuration file

name

The name of a variable from the config file.

value

The value to be assigned to the config variable name.

Details

The configuration file is an R script that is intended to be used to define the variables and helper functions that control the supplied sample report script. The config file may be executed more than once as part of validating its content.

String values in the config file should be quoted using double quote characters. Lists of values are written using the R c() function, for example c("a","b")

Switches controlling behaviour

config.projectName

The Project name for the cover page of the document. This is also printed on the internal page headers.

  • Required

  • No Default Value

config.documentName

The name to be printed on the document cover page.

  • Required

  • No Default value

config.current.dataDir

Data is assumed to be stored in a directory hierarchy, with a root directory and a series of child directories corresponding with the individual web servers, this variable specifies the root directory of that hierarchy. For example a directory structure might be a series of server specific logs under /var/logs/apache, with the individual servers' logs being located in /var/logs/apache/server1, /var/logs/apache/server2 and /var/logs/apache/server3. the data dir in this case is /var/logs/apache with the config.current.dirNames being specified as c("server1", "server2", "server3").

  • Required

  • No Default Value

config.current.dirNames

This is the list of child directory paths, often corresponding with a list of server names, it must be a concatenation of strings, for example c("PRODMAW1","PRODMAW2"). Multiple directory names can be coded here: c("PRODMAW1/app1","PRODMAW2/app1").

  • Required

  • No Default Value

config.current.columnList

The list of column names in the log file, for example

c("Apache", "elapsedus", "jsessionid").

See logFileRead for the list of valid column names. The name Apache is an abbreviation for the Apache common log format:

c("userip", "ignored column 1", "username", "ApacheTimestamp", "url", "httpcode", "responsebytes")

  • Required

  • No Default Value

config.readBaseline

Read a baseline log to be compared with current behaviour. Valid values are either TRUE or FALSE.

  • Optional

  • Default value: FALSE

config.baseline.dataDir

The root directory for the baseline data files

  • Must be supplied if config.readBaseline=TRUE

  • No Default Value

config.baseline.dirNames

The list of baseline log server-specific directories, usually a list of server names, it must be a concatenation of strings, for example c("PRODMAW1","PRODMAW2")

  • Must be specified if config.readBaseline=TRUE

  • No Default Value,

config.baseline.columnList

The list of columns to be read. It is the baseline version of

config.current.columnList

  • Must be specified if config.readBaseline=TRUE

  • No Default Value

config.generateGraphForTimeOver

Response time graphs and histograms are generated for URLs whose maximum elapsed time exceeds this number of milliseconds

  • Optional

  • Default Value: 10000

config.generateServerSessionStats

Generate histograms and counts of requests by server. These are only generated if jsessionid is also one of the column names in the current data

  • Optional

  • Default Value: TRUE

config.generatePercentileRankings

Generate tables that compare frequencies and total elapsed times of URLs in the baseline and current data. Intended to be used for calibrating performance test workloads

  • Optional

  • Default Value: FALSE

config.fix.data

An R function definition that is used to adjust the data read from the log files. This is provided in the sample report configuration file. The function must categorise records using the literals "Static Content Requests" and "Monitoring". The function supplied in the sample.config file created by workingDirectoryPopulate is a good starting point and can be used to subset or correct the log data as it is read to focus on a smaller subset of records.

  • Optional

  • No Default Value

config.fix.current.data

The function to be used to adjust baseline data if different cleaning functions are to be applied to current and baseline data

  • Optional

  • No Default Value

config.fix.baseline.data

The function to use if different functions are to be applied to current and baseline data

  • Optional

  • Default value: config.fix.current.data

config.tempdir

The name of the temp dir to be used for storage of generated graphics.

  • Optional

  • Default Value: ./txdata/

config.useragent.generateFrequencies

Generate the User Agent Frequency Section of the report. Setting this to FALSE suppresses the report, which in any case is only produced if the current dataset contains user agent strings.

  • Optional

  • Default Value: TRUE

config.useragent.minimumPercentage

The minimum percentage that a User Agent family or version must represent to be considered.

  • Optional

  • Default Value: 2

config.useragent.maximumPercentile

The maximum cumulative percentile to report. The last few percent is made up of very low frequency of occurrence User agents that are not feasible (or in many cases possible) to test.

  • Optional

  • Default Value: 96

config.useragent.discardOther

Discard browser family "Other" records. These are typically monitoring or heartbeat sources whose frequencies distort the percentile calculations.

  • Optional

  • Default Value: TRUE

config.author

Name of the author of the report. Displayed on the default first page and in the page footer.

  • Optional

  • Default Value: Author

config.securityClass

The security classification of the document. Displayed on the default first page and in the page footer.

  • Optional

  • Default Value: Commercial-In-Confidence

config.longurls.threshold

The length in characters of a URL above which the URL text is replaced by a placeholder and the URL content is logged. Increasing this number will allow processing of longer URL text, but can lead to problems in LaTeX's processing the file.

  • Optional

  • Default Value: 1000

Value

configVariableIs returns a boolean to indicate existence of a named variable configVariableGet returns the value of the variable configVariableAll returns a list of all variables configVariableSet does not return a value

Author(s)

Greg Hunt <greg@firmansyah.com>

See Also

workingDirectoryPopulate logFileRead logFileListRead

Examples


configVariablesLoad(fileName=paste0(tempdir(),"/xx/sample.config"))
if(configVariableIs("config.documentName"))
{
  print(configVariableGet("config.documentName"))
}
allvars = configVariablesAll()


[Package WebAnalytics version 0.9.12 Index]