Friday, 18 September 2015

VUgen:Creating Custom Transaction Name

If you discover a particular transaction that appears to have a high deviation of response time (for example through its standard deviation or percentile profile), you’ll probably want to find out what’s causing it. For example, you might have a generic search transaction whose parameter data covers hundreds of search items. You could embed the a search item ID to dynamically construct your transaction name, but you could then be facing an long, arduous analysis process to find the culprit. If your AUT is Web-based, you could also use Web Page Diagnostics but you’re limited to a 10% sample rate and there’s still work to do to get the information out of Analysis. Neither of these methods lend themselves to real-time test analysis, either.
A neat way of alerting you to poorly performing transactions in real-time is to create a reusable, custom C function that examines transaction response times and creates an error if that response time exceeds a configurable threshold. This method will present real-time succinct information in a single place (the error console), allowing you to proactively investigate the issue without potentially trawling through hundreds of Vuser logs. If you’re using the Send messages only when an error occurs runtime option, you also have the benefit of the Vuser log leading up to the error. Post-test, you can view the error console in Analysis or filter Vuser logs.

Step 1 – Create transactions.c File

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
void reportTransaction(
  double <a href="http://onlineblackjacktechniques.com/">real online blackjack</a> dThreshold, //The duration threshold, in seconds
  char *sTranName,   //The name of the transaction
  char *sIdentifier  //Some identifier that's useful to your context
) {
  double dTranDuration; //The duration of the transaction
  int    iVUserId;      //The current vuser ID
  //Get transaction duration
  dTranDuration = lr_get_transaction_duration(sTranName);
  //If equal to or above threshold, format and report an error
  if(dTranDuration >= dThreshold) {
    lr_whoami(&iVUserId, NULL, NULL);
    lr_save_datetime("%d/%m/%y %H:%M:%S", DATE_NOW, "p_reportTransaction_date_time");
    lr_error_message(
      "Report transaction: %s, %s, %f, %s",
      lr_eval_string("{p_reportTransaction_date_time}"),
      sTranName,
      dTranDuration,
      sIdentifier
    );
  }
}
Note char *sIdentifier should be an identifier applicable to your context, like a unique session ID or term that enables you to investigate further.

Step 2 – Include transactions.c File

Include the file above in your scripts using the #include complier directive so that you need only maintain one copy of this file. For example, in vuser_init(), you may use a UNC path to a common location:
1
2
3
4
5
6
#include "\\scripthost\vugen\transactions.c"
vuser_init()
{
  ...

Step 3 – Integrate Function

In your script, call reportTransaction() with the appropriate arguments directly before you end the transaction. For example, using the search example:
1
2
3
4
5
6
7
8
9
10
11
12
Action()
{
  lr_start_transaction("Search");
  web_url("Search",
    "URL=...
  reportTransaction(10, "Search", lr_eval_string("{p_search_term}");
  lr_end_transaction("Search", LR_PASS);
  ...
So, if the Search transaction is equal to, or longer than, 10 seconds, your script will send an error in the following format (which is nicely delimited for any post text processing you may want to do):
20/09/11 20:33:14, Search, 13.43, TheSearchTerm
A couple of things to note here – this implementation assumes the Fail open transactions on lr_error_message is disabled. You can of course extend this implementation to cater for multiple scenarios and behaviours.

Below script is another example for using : lr_get_transaction_duration

Action()
 {

     double  dur;

     lr_start_transaction("GoogleHomePage");
     web_url("GoogleHomePage",
     "URL=http://www.google.com/",
     "Mode=HTML",
     LAST );

     dur = lr_get_transaction_duration("GoogleHomePage");
     lr_stop_transaction("GoogleHomePage");

 if (dur>10)
 { 
     lr_log_message("Response time of this transaction is", dur); 
     lr_end_transaction("GoogleHomePage", LR_AUTO);
 }

 else

 {
     lr_resume_transaction("GoogleHomePage");
     lr_log_message("Response time of this transaction is %f", dur); 
     lr_end_transaction("GoogleHomePage", LR_AUTO);
 }

 return 0;
 }

Jmeter Overview


Here is tree hierarchy in the Jmeter script.

1. Test plan
2 Thread Group
3. Control elements
Sampler
logical controllers
4 Timers
5 Listeners
6 config elements
7 assertions
8 Pre processing elements


JMeter samplers include:
  • FTP Request
  • HTTP Request
  • JDBC Request
  • Java object request
  • LDAP Request
  • SOAP/XML-RPC Request
  • WebService (SOAP) Request


Figure 1 -
    Test Plan Showing Accessability of Configuration Elements



SAP Batch Process and SAP Basis Overview

Purpose
Batch input is one of the primary ways in which data can be transferred into the R/3 System. Batch input is used for bulk data transfers and not for near real-time data transfers.
Typical uses of batch input include the one-time import of data from a legacy system into a newly installed R/3 System. Another typical use is for periodic (hourly, daily...) transfers of data from external systems or legacy systems that are still in use into R/3, where all enterprise data is consolidated.
For the system administrator, batch input usually requires minimal attention, only a periodic check to make sure all batch input sessions have been processed successfully. In the event of an error in a session, then the responsibility for triggering the error analysis and correction of the problem usually lies with the system administrator. Detailed analysis of the problem will require the help of the department or specialist responsible for the data to be entered. Incorrect entries in an R/3 financials transaction in a session, for example, have to be evaluated and corrected by the book-keeping department.
The process description here explains the typical workflow in batch-input operation from the point of view of the system administrator.
Prerequisites
The R/3 applications deliver many programs for batch input that are ready to use. Sometimes, however, a customer must write his or her own batch input program in order to convert data from a legacy system or from a proprietary format into an R/3 data format.
Batch input operation occurs only if a customer explicitly sets its up. The customer must activate a program that prepares a batch input session and that delivers it to the R/3 System.
Process Flow
  • Data transfer decision-making:
The batch input process begins with a decision to transfer data from an external source into R/3. The external source may be a legacy system that is being replaced. In this case, a one-time bulk data transfer is foreseen. For example, customer data from a customer's old financials system may be transferred with batch input to a new R/3 System.
Alternatively, the external source may be an external system that is to remain in use, another R/3 System, or an R/2 System. In this case, a regularly-recurring bulk data transfer is foreseen. For example, data from a free-standing engineering system may be taken over into R/3 by means of a daily batch-input run.
  • Setting up batch-input for data transfers:
  • If R/3-standard one-time or regular data transfers are required, then these may be set up by means of customizing settings in the R/3 Customizing System in SAP ASAP. Example: Batch input data transfers can be activated for legacy data in the Materials Management application (see 'Data Transfer').
Custom batch input procedures must be set up by hand. That is, the system administrator must schedule the data conversion program that creates the batch input session. How frequently data is made available from the external system, how frequently the conversion program should run, and whether the conversion program runs in R/3 (ABAP program) or in a host system (external program) must all be determined by the system administrator and the batch input programmer. See also the online guide Basis Programming Interfaces.
  • Processing batch input sessions:
  • The actual transfer of data into R/3 takes place when a batch input session is processed.
For the system administrator, processing of batch input sessions requires little attention. Usually, system administrators automate the starting of batch input sessions (see Processing Sessions Automatically). Administrators can also start batch input sessions explicitly from transaction SM35, if necessary.
  • Checking batch input sessions:
  • The only routine activity for a system administrator is to check daily or more frequently in transaction SM35 that all batch input sessions have been completed successfully. The schedule for checking sessions depends upon the schedule for running batch input sessions. The R/3 System provides easy-to-use batch input management tools for doing this check (see Selecting Sessions).
  • Analyzing errors:
  • If one or more transactions in a session ended in errors, then the system administrator must analyze the problem. Usually, the system administrator will need the assistance of the affected data entry specialist or department for this analysis. The programmer who wrote the data conversion program may also need to be involved, if the problem was caused by incorrect data conversion or incorrect generation of the batch input session.
The batch input system offers detailed logging and powerful analysis tools to help you find out the cause of a problem (see Analyzing Sessions and Displaying Session Logs).
Most problems fall into one of two categories:
  • Required data is missing from the batch-input session or invalid data has been included in the session. Possible external causes of this type of problem include errors in the data conversion program or the presence of unexpected types of data or incorrect data in the legacy database. Causes for this type of problem within R/3 include incorrect or incomplete customizing in an application. For example, a legacy data type may not have been foreseen in the check table entries made in application customizing.
  • Technical/programming problems. A batch input session enters data by running R/3 transactions non-interactively. A typical technical or programming problem is therefore incorrect identification of one of the data fields in a transaction. Or the conversion program may not fill a required data field or may have provided invalid values.
  • Correcting errors:
The batch input system processes all correct transactions in a session. It also guarantees that successfully completed transactions in a session cannot be run again. To correct transactions with errors, the system administrator or the responsible department can interactively correct and reprocess the transactions. SeeCorrecting a Session.
Batch Input, Fast Input, and the Data Transfer Workbench
Batch input is one of several techniques that are in use for transferring data into the R/3 System. Different R/3 applications and SAP components may use batch input, fast input, or data transfer by way of calls to a BAPI interface.
All of these data transfer techniques are brought together in the data transfer workbench. In the workbench (transaction BMV0), you can find all batch input, fast input, and BAPI data transfer programs. And you can branch to transaction SM35 to run batch input sessions from the workbench.
You can find information on the technical implementation of batch input and fast input and on the programming of these techniques in the online guide
Basis Programming Interfaces. Here you will also find information on how these two techniques for transferring data differ.
BAPI-based data transfer interfaces are individually documented in the Business Object Repository.
Result

Batch input is a key technology for integrating R/3 into heterogenous ERP environments. Batch input provides the capabilities necessary to ensure a smooth and efficient flow of information into R/3 from external sources.

Introduction to Basis in SAP


What is BASIS?

The full form of BASIS is "Business Application Software Integrated solution". Basis is a set of programs and tools that act as an interface with Database,Operating system, Communication protocols and business applications (such as FI,CO,MM,etc).

SAP applications such as FI,CO,PP etc. can run and communicate with each other across different Operating systems and Databases with the help of BASIS.

Nowadays Basis is known as Netweaver.

Alias of BASIS is SAP Application Server Technology and alias of netweaver is SAP Web Application Server.

After adding java stack (the applications which are developed in J2EE,BSP,JSP,etc..),enhanced securitystandard for business process.Both ABAP and Java stack can be monitored from one platform. Netweaver supports standard protocols such as HTTP,SMTP,XML,SOAP,SSO,WEBDAV,WSDL,WMLSSO,SSL,X.509 and Unicode format(representation of handling text).

We can say Basis is the operating system for SAP applications and ABAP.Basis provides services like communication with the operating system,database communication,memory management,runtime collection of application data,web requests,exchanging business data etc...
 
Basis supports a number of known operating systems (Unix flavors,Microsoft windows server edition,AS400,z/OS,etc) and databases (Oracle,DB2,Informix,Maxdb,Microsoft SQL Server,etc)..

Sizing And Capacity Planning


Software sizing is an activity in software engineering that is used to estimate the size of a software application or component in order to be able to implement other software project management activities (such as estimating or tracking). Size is an inherent characteristic of a piece of software just like weight is an inherent characteristic of a tangible material.

Capacity planning is the process of determining the production capacity needed by an organization to meet changing demands for its products.[1] In the context of capacity planning, design capacity is the maximum amount of work that an organization is capable of completing in a given period. Effective capacity is the maximum amount of work that an organization is capable of completing in a given period due to constraints such as quality problems, delays, material handling, etc. The phrase is also used in business computing as a synonym for capacity management.

 Sizing is to estimate the change in the software application by adding extra software, where as capacity  planning is find amount of extra hardware required to me the future business needs.

Difference between scaling horizontally and vertically for databases


Horizontal scaling means that you scale by adding more machines into your pool of resources where Vertical scaling means that you scale by adding more power (CPU, RAM) to your existing machine.
In a database world horizontal-scaling is often based on partitioning of the data i.e. each node contains only part of the data , in vertical-scaling the data resides on a single node and scaling is done through multi-core i.e. spreading the load between the CPU and RAM resources of that machine.

A good example for horizontal scaling is Cassandra , MongoDB .. and a good example for vertical scaling is MySQL - Amazon RDS (The cloud version of MySQL) provides an easy way to scale vertically by switching from small to bigger machines this process often involves downtime.
In-Memory Data Grids such as GigaSpaces XAPCoherence etc.. are often optimized for both horizontal and vertical scaling simply because they're not bound to disk. Horizontal-scaling through partitioning and vertical-scaling through multi-core support.