Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
vadimklimov
Active Contributor

Intro


SAP PI system is already shipped with extensive toolset of monitoring applications that can provide aggregated statistics on messages that have been processed in Advanced Adapter Engine (from message overview and performance perspectives). In addition to built-in tools, the one can employ functionality of Solution Manager for centralized monitoring of the PI system in general and statistics of message processing in particular. But there are some cases, when these tools are not sufficient and it is necessary to retrieve statistics of message processing in Advanced Adapter Engine of the SAP PI system for external usage – e.g. in case the consumer of this data is the external monitoring application.

 

To achieve this requirement, it is possible to query two standard servlets of Advanced Adapter Engine that can provide necessary information via HTTP (thus, accessing PI host via J2EE HTTP port - by default, 5<instance number>00). In this blog, I will provide an outlook at their functionality and use cases. The discussed servlets are:

  • MessageOverviewQueryServlet

  • PerformanceDataQueryServlet


 

Both servlets are exposed by Message Display Tool application of Advanced Adapter Engine:

 



 

Requests for these servlets are constructed using input parameters (passed as GET parameters in the URL) and responses are rendered in a form of XML document that can be traversed and analyzed conveniently by the caller application. XSD schemas of responses of the mentioned servlets are accessible via URI /mdt/monitor/<servlet name>.xsd.

 

 

MessageOverviewQueryServlet


The servlet is used to access message processing overview data externally. In PIMON, this is data displayed in Message Monitor -> Message Status Overview.

 

The servlet is accessible via URI:

/mdt/messageoverviewqueryservlet

 

XSD schema of servlet response is accessible via URI:

/mdt/monitor/MessageOverviewQuery.xsd

 

Semantics of the constructed URI for querying servlet is:

/mdt/messageoverviewqueryservlet?component=<XIComponentName>&view=<ViewNameKey>&begin=<IntervalBeginTime>&end=<IntervalEndTime>[&detailedStatus=<true|false>]

 

When querying the servlet, following parameters can be used:

 



































Parameter Description Value format / Possible values
component PI component. Components can be checked in Component Monitor. Examples are central Adapter Engine and non-central Adapter Engine, central Integration Engine and local Integration Engines (proxy runtimes of connected application systems)
view View key. The view defines a set of retrieved attributes and sorting principles for queried message overview statistics

R_ENTRY_VIEW_XPI

S_ENTRY_VIEW_XPI

SR_ENTRY_OVERVIEW_XPI

SR_ENTRY_VIEW_XPI
begin Time period begin time stamp YYYY-MM-DD hh:mm:ss.0
end Time period end time stamp YYYY-MM-DD hh:mm:ss.0
detailedStatus Indicator for showing status groups / detailed status values

true

false

 

If the servlet is called without parameters, the response will contain a list of components that can be queried.

If the servlet is called and a valid value for the component is passed, the response will contain a list of view keys and time periods per period type for which message overview data is available for the specified component. Following period types are supported:

  • HOURLY: message overview data for last 12 hours, aggregated per 1 hour;

  • DAILY: message overview data for last 7 days, aggregated per 1 day;

  • WEEKLY: message overview data for last month, aggregated per 1 week;

  • MONTHLY: message overview data for last 12 months, aggregated per 1 month;

  • ANNUALLY: message overview data for several years, aggregated per 1 year.


 

If the servlet is called and valid values for component, view and time period are passed, the response will contain message overview data for processed messages - namely:

  • Scenario attributes (scenario identifier, sender and receiver communication components, interface);

  • Message counter per message status (for example, for statuses 'System error', 'Waiting', 'To be delivered', 'Delivering', 'Holding', 'Successful', 'Canceled with errors' for Advanced Adapter Engine).


 

Example request (URI part):

/mdt/messageoverviewqueryservlet?component=af.po1.nced60229921a&view=SR_ENTRY_VIEW_XPI&begin=2014-02-24 01:00:00.0&end=2014-02-25 01:00:00.0&detailedStatus=true

 

Response (extract depicting two message overview data set entries):

 



 

Names of respective entry elements of data rows are provided at the beginning of the servlet response XML document:

 



 

The servlet usage is described in the SAP Note 1400785. The servlet is available as of PI release 7.0. Please consult the SAP Note for minimum SP/PL level requirements for the particular PI release.

 

 

PerformanceDataQueryServlet


The servlet is used to access message processing performance data externally. In PIMON, this is data displayed in Performance Monitor.

 

The servlet is accessible via URI:

/mdt/performancedataqueryservlet

 

XSD schema of servlet response is accessible via URI:

/mdt/monitor/PerformanceDataQuery.xsd

 

Semantics of the constructed URI for querying servlet is:

/mdt/performancedataqueryservlet?component=<XIComponentName>&begin=<IntervalBeginTime>&end=<IntervalEndTime>

 

When querying the servlet, following parameters can be used:

 

























Parameter Description Value format / Possible values
component Component of Advanced Adapter Engine. Components can be checked in Component Monitor or in SLD, in registered CIM instances of class SAP_XIAdapterFramework). Examples are central Adapter Engine and non-central Adapter Engine
begin Time period begin time stamp YYYY-MM-DD hh:mm:ss.0
end Time period end time stamp YYYY-MM-DD hh:mm:ss.0

 

If the servlet is called without parameters, the response will contain a list of components that can be queried.

If the servlet is called and a valid value for the component is passed, the response will contain a list of time periods per period type for which performance data is available for the specified component. Following period types are supported:

  • MINUTE: performance data for last 1 hour, aggregated per 15 minutes;

  • HOURLY: performance data for last 24 hours, aggregated per 1 hour;

  • DAILY: performance data for last 7 days, aggregated per 1 day.


 

For PI releases 7.31/7.4, the enhancement was introduced that allows extension of retention period for persisted performance data. Using the parameter PeriodConfig of PerformanceDataQueryServlet, custom values for retention periods can be set. Please note that if Performance Monitor is deactivated, and then activated again, custom values for retention periods for persisted performance data will be overwritten with their default values given above. For more details, please read the SAP Note 2006366.

 

If the servlet is called and valid values for component and time period are passed, the response will contain performance data for processed messages – namely:

  • Scenario attributes (scenario identifier, sender and receiver communication parties, components, communication channels, interface, direction, delivery semantics, etc.);

  • Server node that processed messages for the scenario;

  • Message counter;

  • Important key figures reflecting performance data (maximum, minimum and average message size and retry attempts);

  • Measuring points data (for each measuring point, maximum, minimum and average values in microseconds are provided).


 

Example request (URI part):

/mdt/performancedataqueryservlet?component=af.po1.nced60229921a&begin=2014-02-24 01:00:00.0&end=2014-02-25 01:00:00.0

 

Response (extract depicting a single performance data set entry):

 



 

Names of respective entry elements of data rows are provided at the beginning of the servlet response XML document:

 



 

The servlet usage is described in the SAP Note 1790113. The servlet is available as of PI release 7.31. Please consult the SAP Note for minimum SP/PL level requirements for the particular PI release.

 

 

Outro


You can also check the blog "Michal's PI tips: How to get RWB message overview data to an external system?" written by Michal Krawczyk that discusses usage of MessageOverviewQueryServlet: Michal's PI tips: How to get RWB message overview data to an external system? .

 

It should be noted that described servlets are not the only possibility to access message overview and performance data in Advanced Adapter Engine. On lower level, both servlets are calling ProfileProcessor - a component of Adapter Framework that is used for querying message statistics. Apart from discussed servlets, there are also several other tools that are working as proxies over ProfileProcessor - for example, the web service named ProfileProcessorVi. Consumer of this web service can retrieve message overview and performance data using web service operation getWSData() and passing corresponding application, profile and view keys together with time period and period type.

 



 



 

Overview table of message overview and performance applications as well as profiles and views that are supported by the web service is provided below:

 























Retrieved data Application key Profile key View key
Message overview data sap - XPI_STATISTIC - http://sap.com/xi/XI/Message/30 XPI

R_ENTRY_VIEW_XPI

S_ENTRY_VIEW_XPI

SR_ENTRY_OVERVIEW_XPI

SR_ENTRY_VIEW_XPI
Performance data sap - XPI_PERFORMANCE_STATISTIC - http://sap.com/xi/XI/Message/30 XPI_PERFORMANCE ENTRY_VIEW_XPI_PERFORMANCE

 

The web service ProfileProcessorVi is used by some SAP standard applications that are querying PI message statistics - for example, some applications of Solution Manager are actively using this web service. But consumption of this web service is more complicated in comparison to described servlets - just some reasons for this are listed below:

  • More complex structure of the request that needs to be constructed and sent to the web service;

  • More complex structure of the response that needs to be traversed (for example, actual statistics data is put in a hash form that requires further processing efforts);

  • Additional operations that are required for correct completion of work with the ProfileProcessor after message statistics data is retrieved - namely, release of lock that have to be addressed in extra calls to the web service (by invocation of its operation processAction()).


 

Taking all these concerns into consideration, the web service ProfileProcessorVi can be considered as an alternative for servlets MessageOverviewQueryServlet and PerformanceDataQueryServlet, but is not really exposed officially for external usage in custom solutions and thus is not in scope of this blog.

33 Comments
Labels in this area