Splunk AppDynamics

How to parse a list of custom objects in Java?

Harshad_Loya
New Member

Hi,

I am trying to create an information point to collect metrics on a a particular method of a particular class getting called.

I want to customize this information point to calculate metrics based on certain values being present in the parameter object of the method. So I am using the match condition.

I have 2 options of classes with their methods to be used.

1st Option - doesnt have a toString() implementation so I have to use the Getter Chain.

2nd Option - my method is a private method but the parameter object has both toString() implementation and Getter Chains.


Already tried the following and am facing certain issues on each:

1. I tried to use regex on toString() of the parameter of my 2nd option but for some reason its not getting any metric counts. I dont see any errors on the controller but its not working.

2. I tried to do getX().getY().toString() in Option 1 using Getter chain but still aint getting any metrics. 
3. I tried to use just the getX().getY().getZ() using Getter Chain (with both Option 1 and 2) but I am stuck at a condition.
getZ() returns a list of custom objects.
For example the custom object:


Person {
String name;
int age;
int somethingElse;
}
(assuming there are getters, setters, hashcode, equals and toString defined)

How do I do list contains name = "Harshad" ? The object with name "Harshad" can be at any index but it will be available only once.
I am assuming I need to use "contains". But how?
Can someone give some examples?
Labels (1)
Tags (1)
0 Karma

Morelz
Builder

Hi

When doing live preview, what does the data look like?

Can you do a live preview on the second option, and show what your class/method data returns?

Just hide sensitive data , if any

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Synthetic Monitoring - Resolved Incident on Detector Alerts

We’ve discovered a bug that affected the auto-clear of Synthetic Detectors in the Splunk Synthetic Monitoring ...

Video | Tom’s Smartness Journey Continues

Remember Splunk Community member Tom Kopchak? If you caught the first episode of our Smartness interview ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud? Learn how unique features like ...