Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#478: Labeling of Transactions, Actions, and Requests #507

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/xsl/loadreport/util/timer-row.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
</xsl:if>
</td>

<!-- label -->
<xsl:if test="$type = 'transaction' or $type = 'action' or $type = 'request'">
<td class="key colgroup1 forcewordbreak">
<xsl:value-of select="labels/*" />
</td>
</xsl:if>

<!-- count -->
<td class="value number">
<xsl:value-of select="format-number(count, '#,##0')" />
Expand Down
10 changes: 7 additions & 3 deletions config/xsl/loadreport/util/timer-summary-row.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
<xsl:with-param name="class" select="'key colgroup1'"/>
</xsl:call-template>

<!-- label -->
<xsl:if test="$type = 'transaction' or $type = 'action' or $type = 'request'">
<td class="colgroup1"></td>
</xsl:if>

<!-- count -->
<td class="value number">
<xsl:value-of select="format-number(count, '#,##0')"/>
Expand Down Expand Up @@ -105,9 +110,8 @@
<!-- runtime segmentation -->
<xsl:if test="$type = 'request'">
<xsl:for-each select="countPerInterval/int">
<xsl:variable name="position" select="position()" />
<xsl:variable name="percentage"
select="../../percentagePerInterval/big-decimal[$position]" />
<xsl:variable name="position" select="position()"/>
<xsl:variable name="percentage" select="../../percentagePerInterval/big-decimal[$position]"/>
<td class="value number">
<span>
<xsl:attribute name="title">
Expand Down
9 changes: 6 additions & 3 deletions config/xsl/loadreport/util/timer-table.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
<button class="clear-input" type="clear" title="Click to clear">&#x2715;</button>
</form>
</th>
<xsl:if test="$type = 'transaction' or $type = 'action' or $type = 'request'">
<th rowspan="2" class="table-sortable:alphanumeric colgroup1" id="sortByLabel">Label</th>
</xsl:if>
<xsl:choose>
<xsl:when test="$type = 'request'">
<th colspan="5">Count</th>
Expand Down Expand Up @@ -148,13 +151,13 @@
<xsl:variable name="columnCount">
<xsl:choose>
<xsl:when test="$type = 'request'">
<xsl:value-of select="11 + $percentileCount + count($runtimeIntervalsNode/interval)"/>
<xsl:value-of select="13 + $percentileCount + count($runtimeIntervalsNode/interval)"/>
</xsl:when>
<xsl:when test="$type = 'transaction'">
<xsl:value-of select="12 + $percentileCount"/>
<xsl:value-of select="13 + $percentileCount"/>
</xsl:when>
<xsl:when test="$type = 'action'">
<xsl:value-of select="12 + $percentileCount"/>
<xsl:value-of select="13 + $percentileCount"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="11 + $percentileCount"/>
Expand Down
8 changes: 6 additions & 2 deletions doc/internal-doc/api.sig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Signature file v4.1
#Version 8.0.0
#Version 8.3.0

CLSS public abstract com.xceptance.xlt.api.actions.AbstractAction
cons protected init(com.xceptance.xlt.api.actions.AbstractAction,java.lang.String)
Expand Down Expand Up @@ -278,17 +278,19 @@ intf com.xceptance.xlt.api.engine.Data
meth public char getTypeCode()
meth public final void setAllValues(java.util.List<com.xceptance.xlt.api.util.XltCharBuffer>)
meth public java.lang.String getAgentName()
meth public java.lang.String getLabel()
meth public java.lang.String getName()
meth public java.lang.String getTransactionName()
meth public java.util.List<java.lang.String> toList()
meth public long getTime()
meth public void setAgentName(java.lang.String)
meth public void setBaseValues(java.util.List<com.xceptance.xlt.api.util.XltCharBuffer>)
meth public void setLabel(java.lang.String)
meth public void setName(java.lang.String)
meth public void setTime(long)
meth public void setTransactionName(java.lang.String)
supr java.lang.Object
hfds agentName,name,time,transactionName,typeCode
hfds agentName,label,name,time,transactionName,typeCode

CLSS public com.xceptance.xlt.api.engine.ActionData
cons public init()
Expand All @@ -315,12 +317,14 @@ hfds TYPE_CODE,value
CLSS public abstract interface com.xceptance.xlt.api.engine.Data
meth public abstract char getTypeCode()
meth public abstract java.lang.String getAgentName()
meth public abstract java.lang.String getLabel()
meth public abstract java.lang.String getName()
meth public abstract java.lang.String getTransactionName()
meth public abstract java.util.List<java.lang.String> toList()
meth public abstract long getTime()
meth public abstract void setAgentName(java.lang.String)
meth public abstract void setBaseValues(java.util.List<com.xceptance.xlt.api.util.XltCharBuffer>)
meth public abstract void setLabel(java.lang.String)
meth public abstract void setName(java.lang.String)
meth public abstract void setRemainingValues(java.util.List<com.xceptance.xlt.api.util.XltCharBuffer>)
meth public abstract void setTime(long)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
################################################################################
#
# Data Record Labeling Rules
#
# During report creation, data records may get a custom label. For example, all
# requests in the checkout area of a shopping app could be labeled with
# "checkout". Use these labels for advanced analysis with XLT or other tools.
# They will be part of both the HTML report and the XML data file.
#
# The automatic labeling of data records is controlled by "labeling rules". A
# rule knows how to select all data records of interest and how to process them.
#
# You may specify one or more rules as outlined below:
#
# com.xceptance.xlt.reportgenerator.labelingRules.<num>.<param> = <value>
#
# The rules are sorted numerically based on <num> and are applied in ascending
# order.
#
# The supported values for "<param>" are:
#
# newLabel ................. The new label (required)
#
# namePattern [n] .......... Regex defining a matching record name
# labelPattern [l] ......... Regex defining a matching label
# typeCodePattern [t] ...... Regex defining a matching record type code
#
# stopOnMatch .............. Whether or not to process the next rule even if
# the current rule applied (defaults to true).
#
# If more than one pattern is given, all given patterns must match for the
# record to be processed.
#
# Note that newLabel may contain placeholders, which are replaced with the
# specified capturing group from the respective pattern. The placeholder
# format is as follows: {<category>:<capturingGroupIndex>}, where <category> is
# the type code of the respective pattern (given in brackets above) and
# <capturingGroupIndex> denotes the respective capturing group in the selected
# pattern.
#
# You may also use just {<category>} as placeholder. Such placeholders do not
# require a pattern and are resolved to the full text of the respective record
# attribute.
#
# Excluding instead of Including
#
# com.xceptance.xlt.reportgenerator.labelingRules.<num>.<param>.exclude = <value>
#
# All records that match the exclude pattern will not be selected. For example,
# to label all transaction data records with a name other than "TOrder" with
# "anonymous", you would setup a rule like that.
#
# com.xceptance.xlt.reportgenerator.labelingRules.1.newLabel = anonymous
# com.xceptance.xlt.reportgenerator.labelingRules.1.namePattern.exclude = TOrder
# com.xceptance.xlt.reportgenerator.labelingRules.1.typeCodePattern = T
#
# Please note that an include pattern as well as an exclude pattern can be specified for
# a pattern type at the same time. In this case, a record is selected if and only if it
# matches the include pattern, but does not match the exclude pattern.
#
################################################################################

### Request/Action Labeling ###

## Homepage
com.xceptance.xlt.reportgenerator.labelingRules.1.newLabel = homepage
com.xceptance.xlt.reportgenerator.labelingRules.1.namePattern = ^Homepage
com.xceptance.xlt.reportgenerator.labelingRules.1.typeCodePattern = A|R

## Catalog
com.xceptance.xlt.reportgenerator.labelingRules.2.newLabel = catalog
com.xceptance.xlt.reportgenerator.labelingRules.2.namePattern = ^(SelectTopCategory|SelectCategory|ProductDetailView)
com.xceptance.xlt.reportgenerator.labelingRules.2.typeCodePattern = A|R

## Cart
com.xceptance.xlt.reportgenerator.labelingRules.3.newLabel = cart
com.xceptance.xlt.reportgenerator.labelingRules.3.namePattern = ^(AddToCart|ViewCart)
com.xceptance.xlt.reportgenerator.labelingRules.3.typeCodePattern = A|R

## Checkout
com.xceptance.xlt.reportgenerator.labelingRules.4.newLabel = checkout
com.xceptance.xlt.reportgenerator.labelingRules.4.namePattern = ^(StartCheckout|EnterShippingAddress|EnterBillingAddress|EnterPaymentMethod)
com.xceptance.xlt.reportgenerator.labelingRules.4.typeCodePattern = A|R

## Order
com.xceptance.xlt.reportgenerator.labelingRules.5.newLabel = order
com.xceptance.xlt.reportgenerator.labelingRules.5.namePattern = ^(PlaceOrder)
com.xceptance.xlt.reportgenerator.labelingRules.5.typeCodePattern = A|R

## Account
com.xceptance.xlt.reportgenerator.labelingRules.6.newLabel = account
com.xceptance.xlt.reportgenerator.labelingRules.6.namePattern = ^(Login|Logout|Register|GoToRegistrationForm|GoToSignIn)
com.xceptance.xlt.reportgenerator.labelingRules.6.typeCodePattern = A|R


### Transaction Labeling ###

## Registered
com.xceptance.xlt.reportgenerator.labelingRules.10.newLabel = registered
com.xceptance.xlt.reportgenerator.labelingRules.10.namePattern = ^TOrder
com.xceptance.xlt.reportgenerator.labelingRules.10.typeCodePattern = T

## Anonymous
com.xceptance.xlt.reportgenerator.labelingRules.11.newLabel = anonymous
#com.xceptance.xlt.reportgenerator.labelingRules.11.namePattern =
com.xceptance.xlt.reportgenerator.labelingRules.11.typeCodePattern = T

21 changes: 21 additions & 0 deletions src/main/java/com/xceptance/xlt/api/engine/AbstractData.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public abstract class AbstractData implements Data
*/
private String agentName;

/**
* The custom label determined by the labeling rules. Only used during report generation or analysis.
*/
private String label;

/**
* Creates a new AbstractData object and gives it the specified name and type code.
*
Expand Down Expand Up @@ -216,4 +221,20 @@ public List<String> toList()

return fields;
}

/**
* {@inheritDoc}
*/
public String getLabel()
{
return label;
}

/**
* {@inheritDoc}
*/
public void setLabel(String label)
{
this.label = label;
}
}
15 changes: 15 additions & 0 deletions src/main/java/com/xceptance/xlt/api/engine/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,19 @@ public interface Data
* the transaction's name
*/
public void setTransactionName(String transactionName);

/**
* Returns the custom label determined by the labeling rules. Only used during report generation or analysis.
*
* @return the custom label
*/
public String getLabel();

/**
* Sets the custom label determined by the labeling rules. Only used during report generation or analysis.
*
* @param label
* the custom label
*/
public void setLabel(String label);
}
Loading