Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
04-19-2018 03:50 AM
Hi team,
We have the following custom code created in order to monitor calls to IBM MQs:
...
private String component, process, activity, sentTo, origin, message, response;
public String init(String component, String process, String activity, String payload, String regex, String queueOrigin) {
That method returns a "message".
Then the following "get" methods have been created for each case, for example to capture the size of the message:
...
public int getMessageSizeBytes(){
return message.getBytes().length;
}
...
How to use them as getter chains to capture those information on Data Collectors? How to capture the result of getMessageSizeBytes?
I mean, the first method returns a message, that is already captured but... how to obtain its size?
The method getMessageSizeBytes is already added on the code, but the getter chain is not capturing that value...
Which configuration should be used? Please kindly check attached image
Thanks!
04-19-2018 04:02 AM
Moco,
You need to define a data collector on a method that is called as part of the processing of the BT.
That data collector can access methods on any of:
The key here is that a data collector is passive - it needs to be placed on a method that will be run in the course of the processing of the BT in order that it can step in and collect the data you need.
Warm regards,
Peter
04-19-2018 04:46 AM
Thanks Petter,
As you can see in the attached image, we are trying to define the getter chains on a method invocation data collector for the initial method "init"... is this configuration correct, please?
The input parameters and the return message are properly detected, however the value returned by the get size function is not properly obtained... do you know why?
Which getter chain expression shuld we use exactly?
Thanks a lot!
04-19-2018 05:01 AM
So when during the BT execution is your init method called? Can you provide a snippet of the application code that shows the context of that call?
Warm regards,
Peter
04-19-2018 07:18 AM
Hi,
Yes, init method is being captured in AppDynamics BTs.
In fact the returned message is properly displayed as data collector (please see attached image with all the parameters), using the "ReturnValue.toString()" configured as Method Data Invocation:
- Collection Data From: Return Value
- Operation on Invoked Object: Use toString()
But the issue heer is which getter chain expression should be used to capture the size of the message, calculated with
public int getMessageSizeBytes(){
return message.getBytes().length;
}.
Sorry, but I do not have access all the code, just that related to those method (please find it attached)
Thanks
04-19-2018 07:18 AM
Hi,
Yes, init method is being captured in AppDynamics BTs.
In fact the returned message is properly displayed as data collector (please see attached image with all the parameters), using the "ReturnValue.toString()" configured as Method Data Invocation:
- Collection Data From: Return Value
- Operation on Invoked Object: Use toString()
But the issue heer is which getter chain expression should be used to capture the size of the message, calculated with
public int getMessageSizeBytes(){
return message.getBytes().length;
}.
Sorry, but I do not have access all the code, just that related to those method (please find it attached)
Thanks
04-19-2018 07:31 AM
Ah, OK. That validates that the collector is getting called, which is what I wanted to confirm.
I think the problem you're running in to is that the getter chain wants to get the data value as a string, and since your method returns an un-boxed int, it can't do the necessary type conversion.
It should work if you change your method to return the length as a String, or an an Integer (which has a toString method that could be used to yield a string result)
Warm regards,
Peter
04-03-2019 11:53 AM
Public Class Order {
public string ClOrdID
{
get;
set;
}
}
public Order SendOrder(Order ord) {}
What will be getter chain for collecting value of ClOrdID. Remember its .net property and there is no getClordID() method defined explicitly.
04-04-2019 08:47 AM
For .NET properties, you can just use the property name and the agent will automatically use the get internally: ClOrdID
04-04-2019 09:25 AM
Another scenarios: How to achive it.
1) private bool SendBulkOrders(List<Order> orders) {}
how to collect data from parameter which is collection of data. In above example i want to cllect orders[0].BucketId
2) private bool SendObject(Object sender) {}
In above example, i want to typecast sender to Employee type and collect employe id. like ((Employe)sender).EmpId
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form