DX Application Performance Management

Expand all | Collapse all

Custom metric agent in a custom calculator? Load balancing custom calculato

Jump to Best Answer
  • 1.  Custom metric agent in a custom calculator? Load balancing custom calculato

    Posted 07-13-2012 11:35 AM
      |   view attached
    Hi,

    This is a little complicated, please take some time to read. This could benefit many here in the community. Our application has 50 JVMs. First I created a metric grouping then created a calculator to average the metric grouping (screen shot below). The calculator created a new custom metric "Servlets Weighted Avg WebServlet", under Custom Metric Host (Virtual)|Custom Metric Process (Virtual)|Custom Metric Agent (Virtual). That's the easy part.

    The complicated part is I need to use this new custom metric in the custom calculator to produce another new metric. How to get custom metric into custom calculator?

    Here is the scenario.

    Consider this as load balancing custom calculator. Let's assume servlets represent incoming requests to the jvm. When I create the calculator to average the metric grouping (referenced above), this will give the "overall average" incoming requests per jvm. I'm writing a custom calculator to compare the "current" incoming requests against the "overall average" incoming requests. If this number is too low, we will know the jvm is taking much less load compares to other JVMs. Likewise, if the number is too high, the JVM is taking alot more load than other JVMs.

    Please share your ideas and approaches.

    -VLu


  • 2.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu

    Posted 07-13-2012 07:06 PM
    Why not do this with a JavaScript calculator instead? You can grab the metrics and do all of the averages and compares at the MOM or collectors and save yourself this headache.


  • 3.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu

    Posted 07-16-2012 09:17 AM
    Thank you, hdavis. I wrote the javascript calculator over the weekend and put it on the MOM. I remember I read somewhere javascript calculator should not be on the MOM. There is something that should not be on the MOM. Thank you.


  • 4.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu

    Posted 07-16-2012 11:10 AM
    There will be times when you do not want a calculator to run on a MOM. On those occastions, you need to add another function to your calculator:
    //Return false if the script should not run on the MOM.
    //Scripts that create metrics on agents other than the Custom Metric Agent
    //should not run on the MOM because the agents exist only in the Collectors.
    //Default is true.
    function runOnMOM() 
    {
    
    return false;
    }


  • 5.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu

    Posted 07-16-2012 11:52 AM
    hdavis, the javascript calculator produces the number I wanted but is there anyway to display this number in the Investigator? I got warning in the MOM log.

    Thanks.
    7/16/12 11:42:40 AM EDT [WARN] [Manager.MetricCalculatorBean] Calculator Registered Metric <ID=1645, JavaScript calculator /opt/wily/Introscope8.2.2.0/./scripts/GEICO-ServletLoadDistPct_sample_vlu.js>.  A JavaScript calculator in the MOM cannot output metric data to an agent that exists in a Collector: SuperDomain/Apps|host|Tomcat|agent|Servlets|WebServlet:Responses Per Interval Dist Pct
    7/16/12 11:42:40 AM EDT [WARN] [Manager.MetricCalculatorBean] To prevent a JavaScript calculator from running in the MOM, the JavaScript should implement a runOnMOM function that returns false


  • 6.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu

    Posted 07-16-2012 12:49 PM
    If MOM is complaining about running the script, ensure to add the function 'runOnMOM", set to 'false', and in move your script and move it to your Collector. If you have multiple Collectors, place a copy on each.


  • 7.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu

    Posted 07-16-2012 03:05 PM

    hdavis wrote:

    You can grab the metrics and do all of the averages and compares at the MOM or collectors and save yourself this headache.
    Sorry if I wasn't clear earlier. I'm able to grab all the metrics and do the averages at the MOM but when I try to display the new metric, the MOM would not allow it. Is there anyway for the newly calculated metrics to appear on the Investigator if the javascript is on the MOM?


  • 8.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu

    Posted 07-16-2012 03:38 PM
    According to your log entries on MOM, it states you need to run it from a Collector.
    Move your calculator to <EM_HOME>/scripts on your Collector and restart the Collector. Monitor the EM log and verify that it loads properly.


  • 9.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu
    Best Answer

    Posted 07-18-2012 04:02 PM
    Thank you, hdavis.

    Found solution - using javascript calculator on the MOM to grab all the metrics and save the new metrics in the MOM SmartStor.


  • 10.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu

    Posted 07-18-2012 05:39 PM
    VLu,

    How did you get around the warning on the MOM? Did you accomplish this by changing the resulting metric name so that it wasn't saved to one of the agents on a Collector?


  • 11.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu

    Posted 07-18-2012 11:05 PM
    @jakbutler, Yes and yes to your second question. I do have to manipulate the resulting metric name so that it is saved on the MOM, not on the Collector.

    Regarding to your first question ("How did you get around the warning on the MOM?"), I need to know additional details before I can answer your question on your situation. In your Investigator tree, do you use Domains or everything are under the Superdomain node?


  • 12.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu

    Posted 07-19-2012 11:59 AM

    VLu wrote:

    Regarding to your first question ("How did you get around the warning on the MOM?"), I need to know additional details before I can answer your question on your situation. In your Investigator tree, do you use Domains or everything are under the Superdomain node?
    You actually answered both of my questions (the first was just a lead-in for the second, really). To answer yours, however, we do use Domains; only our Admins have access to SuperDomain. Thank you!


  • 13.  RE: Custom metric agent in a custom calculator? Load balancing custom calcu

    Posted 07-19-2012 12:24 PM
    Great! To save anything under the MOM, the agent's prefix needs to start with either:

    SuperDomain|Custom Metric Host (Virtual)|Custom Metric Process (Virtual)|Custom Metric Agent (Virtual) <-- no domain
    SuperDomain/DomainName|Custom Metric Host (Virtual)|Custom Metric Process (Virtual)|Custom Metric Agent (Virtual) <-- if you're using domains.