Hello All,
I need to capture key value pair from a method.
eg. I have multiple method MyObject.setAttribute methods.
MyObject.setAttribute(String attrName, String attrValue)
MyObject.setAttribute(String attrName, Integer attrValue)
MyObject.setAttribute(String attrName, Boolean attrValue)
The method "MyObject.setAttribute" gets invoked multiple times & for different types of objects. So when I put a sensor for this method, lots of data gets generated.
Now for a Business Transaction, I need the data based on the attrName.
For instance, the attributes for which I need capture information are as follows:
attrName - objName with String value attrName - objNumber with String value attrName - objQuantity with Integer value
I want to see this information in a Business Transaction based on the above 3 parameters (splittings) and alongwith a common parameter say the logged-in User Name.
I tried multiple combinations as follows :
A) Measures created:
1) Method Argument Value - 1st Arg - match regex with "objName|objNumber" 2) Method Argument Value - 2nd Arg (String value)
This gives me all the invocations of the setAttribute method for "objName" & "objNumber". As mentioned earlier, it also gives me unwanted information as this is a common method.
B) Measures created:
1) Method Argument Value - 1st Arg - match regex with "objName|objNumber|objQuantity" 2) Method Argument Value - 2nd Arg (String value) 3) Method Argument Value - 2nd Arg (Integer value)
Does not work as expected. I do not get the desired information. Probably due to the 3rd Measure.
Is there any way I can get the desired information in a single Business Transaction? Any help would be appreciated.
Thanks
Answer by PTC S. ·
To clarify the question some more:
As part of a purepath the setAttribute(String attrName, Integer attrValue) and setAttribute(String attrName, String attrValue) methods gets called several times. For example:
setAttribute(ID, 10)
setAttribute(Name, Hotel)
setAttribute(Number, 500)
setAttribute(Quantity, 4)
setAttribute(City, Chicago)
setAttribute(State, IL)
I want to create a Business Transaction with splittings capturing the argument values for Name, Number and Quantity only and not capture the values for the other 3 setAttribute calls. It does not seem possible to create a measure which will capture the attrValue based on the attrName in a single business transaction since the attrValue can be either a string or an Integer. It looks like the only way to do this is to create two Business Transactions one with splittings which capture String values and the other for Integer values. Is there a way this can be accomplished with a single Business Transaction?
Any help would be greatly appreciated.
JANUARY 15, 3:00 PM GMT / 10:00 AM ET