一个减少SAP CRM product harmonization时体力活的工具

77 阅读1分钟

Created by Wang, Jerry, last modified on Jan 05, 2017

In order to avoid unnecessary repeated routine code to measure performance such as below:
" get timestamp1
" run the method whose performance you want to measure
" get timestamp2
" duration = timestamp2 - timestamp1
I write this small tool in ER9/001.

An example of performance comparison requirement

Suppose I have written a class ZCL_CRM_CODEPLOY_DATA_TOOL which has two methods:

  1. SELECT_FROM_CDS_VIEW: read data from table ZCOMM_PRODUCT, which is redirected to a CDS view
  2. SELECT_FROM_ZCOMM_PRODUCT2: read data from table ZCOMM_PRODUCT2 as usual In order to avoid unnecessary repeated routine code to measure performance such as below:

" get timestamp1
" run the method whose performance you want to measure
" get timestamp2
" duration = timestamp2 - timestamp1

I write this small tool in ER9/001.

How to use it

Suppose I have written a class ZCL_CRM_CODEPLOY_DATA_TOOL which has two methods:

  1. SELECT_FROM_CDS_VIEW: read data from table ZCOMM_PRODUCT, which is redirected to a CDS view
  2. SELECT_FROM_ZCOMM_PRODUCT2: read data from table ZCOMM_PRODUCT2 as usual
    And I would like to compare the performance of these two approaches. Now I do not need to write routine code to execute the method and measure the performance. Instead just run report ZCO_PERFORMANCE_TEST in ER9/001:

Run the report, it will execute the methods for you and display duration of each method execution ( unit: microsecond )
要获取更多Jerry的原创文章,请关注公众号"汪子熙":