4 Replies Latest reply: Jul 10, 2018 1:02 PM by Paul Lambert RSS

AppInternals 10 REST API - Per Instance CPU usage?

Paul Lambert

Our last holdout on version 9 uses the tables to generate daily Instance CPU and heap usage reports to provide insight into resource requirements.  This information is only available in graph format in AI10's user interface and I was hoping to be able to automate this report using scripts and the REST API.  Unfortunately this metric does not seem to exist.  The only CPU metrics I could find do not belong to the Instance category.

 

Any thoughts?

  • Re: AppInternals 10 REST API - Per Instance CPU usage?
    Golan Shem-Tov

    Paul,

     

    Thank you very much for your post.

    Just wanted to verify, did you check the list of metrics with the object categories helper?

    AppInternals Metrics API v1.0

    This ( https://www.steelcentral.net/scai.metrics/1.0/object_categories ) gave me a list of all the metrics under the different categories, when I check what is there under instance i see these which seem to include cpu and memory information. Does this include the metrics you are looking for?  

     

    object_category_name "INSTANCE"

    display_name "instance"

    applicable_metrics

    0 "CLR\\Gen0 Heapsize"

    1 "CLR\\Gen1 Heapsize"

    2 "CLR\\Gen2 Heapsize"

    3 "CLR\\Large Object Heapsize"

    4 "GarbageCollector\\% CollectionTime"

    5 "GarbageCollector\\CollectionCount"

    6 "HEAP MemoryPool\\Usage used"

    7 "HEAP MemoryPool\\Usage used / sec"

    8 "Memory Management\\-Total-\\Heap MBs in use"

    9 "Memory Management\\-Total-\\MBs in use"

    10 "Memory Management\\-Total-\\non-Heap MBs in use"

    11 "Memory Management\\\\% time garbage collecting"

    12 "Memory Management\\\\MBs consumed / sec"

    13 "Memory Management\\\\Working Set (MB)"

    14 "Memory Management\\\\garbage collections / sec"

    15 "Memory Management\\\\virtual size"

    16 "Memory\\-Total-\\HeapMemoryUsage used"

    17 "Memory\\-Total-\\NonHeapMemoryUsage used"

    18 "NON_HEAP MemoryPool\\Usage used"

    19 "Process#CPU\\\\Busy (%)"

    20 "Process#CPU\\\\System (%)"

    21 "Process#CPU\\\\User (%)"

    22 "Process#I/O\\\\Other Total (MB)"

    23 "Process#I/O\\\\Read Total (MB)"

    24 "Process#I/O\\\\Total (MB)"

    25 "Process#I/O\\\\Write Total (MB)"

    26 "Process#Memory\\\\Faults"

    27 "Process#Memory\\\\Faults Soft"

    28 "Process#Memory\\\\Page File (MB)"

    29 "Process#Memory\\\\Pool Nonpaged (MB)"

    30 "Process#Memory\\\\Pool Paged (MB)"

    31 "Process#Memory\\\\Swaps"

    32 "Threads\\-Aggregate-\\total runnable threads"

    33 "Threads\\-Aggregate-\\total waiting threads"

    34 "apdex"

    35 "count"

    36 "exception_count"

    37 "major_violation"

    38 "minor_violation"

    39 "percent_violations"

    40 "server_duration"

     

     

     

     

    Thanks

    Golan

    • Re: AppInternals 10 REST API - Per Instance CPU usage?
      Paul Lambert

      When I query that list of metrics, many return null values including the CPU ones.

       

      I assume it's a placeholder that will be added later but it doesn't work as of 10.12.1 build 13.

       

      Thanks for your response though.

      • Re: AppInternals 10 REST API - Per Instance CPU usage?
        Golan Shem-Tov

        Paul,

        I ran a query against a test system and I am seeing results, it may be a timestamp issue, a version issue or something else.

        Can you please open this with support so we can expedite the resolution?

        If you would like to I can give you credentials to my system and you can run your query against it and try to narrow down the issue.

         

        Golan Shem-Tov

        gshemtov@riverbed.com

         

        PS. Just in case it can help, this is the query that I ran against a test system (start time is in April 25th as this was a part of an internal workshop i ran a while back).

        I ran this POST  https://steelcentral.net/scai.metrics/1.0/metrics

        With this in the body

         

        {

          "start_time_secs": 1524693600,

          "duration_secs": 900,

          "bucket_width_secs": 60,

          "include_timeseries": false,

          "object_filters": [

            {

              "object_category_name": "INSTANCE",

              "instance_name": "Tomcat__opt_tomcat1-client"

            }

          ],

          "metric_statistic_pairs": [

            {

              "metric_name": "Process#CPU\\\\Busy (%)",

              "statistic_name": "avg"

            },

            {

              "metric_name": "Process#CPU\\\\System (%)",

              "statistic_name": "avg"

            },

                {

              "metric_name": "Process#CPU\\\\User (%)",

              "statistic_name": "avg"

            }

          ]

        }

         

         

        ====================

        = =  This is the result    ==

        ====================

        {

        "id": 0

        "metrics_values":

        {
        "key": {
        "metric_name": "Process#CPU\\Busy (%)"

         

        "statistic_name": "avg"

        }

        "summary_value": 0.0975532978773117

        "timeseries_values":

        }

        {

        "key": {
        "metric_name": "Process#CPU\\System (%)"

         

        "statistic_name": "avg"

        }

        "summary_value": 0.0076954299584031105

        "timeseries_values":

        }

        {

        "key": {
        "metric_name": "Process#CPU\\User (%)"

         

        "statistic_name": "avg"

        }

        "summary_value": 0.05008137971162796

        "timeseries_values":

        }

        "timeseries_bucket_width_secs": 60

        }