Chapter 8. Enabling API Profiling Framework

 

Genius is 1 percent inspiration and 99 percent perspiration.

 
 --Thomas Aha Edison

Enabling the perfBasic API profiling framework is easy if your existing applications already have the capability of writing API calls to external log files in the text format. If such log files already contain the API profiling data specified by the perfBasic API profiling framework, then you only need to rewrite your logged data according to the logging format required by the perfBasic API profiling framework. This can easily be done using an adapter program, as will be elaborated in the next chapter.

For an application that has no built-in capability of logging API calls, API profiling statements can be inserted into its source code using an external program such as perfLog.java written by the author for illustration purposes. In this chapter, I will briefly walk through the source code of this program with you. This will expose some issues with enabling API profiling to profile existing software. The task is as easy as inserting profiling statements into the source code of a program as the beginning or ending statement in a method or procedure. However, there are many delicate issues to deal with.

Although perfLog.java is implemented in Java for enabling Java applications, it can be used as a useful reference for implementing an enabling program for applications written in any other high-level programming languages.

Let's first begin with the overall structure ...

Get Software Performance and Scalability: A Quantitative Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.