• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

P_TimeTrace.h

Go to the documentation of this file.
00001 /** @file
00002 
00003   A brief file description
00004 
00005   @section license License
00006 
00007   Licensed to the Apache Software Foundation (ASF) under one
00008   or more contributor license agreements.  See the NOTICE file
00009   distributed with this work for additional information
00010   regarding copyright ownership.  The ASF licenses this file
00011   to you under the Apache License, Version 2.0 (the
00012   "License"); you may not use this file except in compliance
00013   with the License.  You may obtain a copy of the License at
00014 
00015       http://www.apache.org/licenses/LICENSE-2.0
00016 
00017   Unless required by applicable law or agreed to in writing, software
00018   distributed under the License is distributed on an "AS IS" BASIS,
00019   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020   See the License for the specific language governing permissions and
00021   limitations under the License.
00022  */
00023 
00024 
00025 /****************************************************************************
00026 
00027   TimeTrace.h
00028  ****************************************************************************/
00029 
00030 #ifndef _P_TimeTrace_h_
00031 #define _P_TimeTrace_h_
00032 
00033 // #define ENABLE_TIME_TRACE
00034 
00035 #define TIME_DIST_BUCKETS               500
00036 #define TIME_DIST_BUCKETS_SIZE          TIME_DIST_BUCKETS+1
00037 
00038 #ifdef ENABLE_TIME_TRACE
00039 extern int cdb_callback_time_dist[TIME_DIST_BUCKETS_SIZE];
00040 extern int cdb_cache_callbacks;
00041 
00042 extern int callback_time_dist[TIME_DIST_BUCKETS_SIZE];
00043 extern int cache_callbacks;
00044 
00045 extern int rmt_callback_time_dist[TIME_DIST_BUCKETS_SIZE];
00046 extern int rmt_cache_callbacks;
00047 
00048 extern int lkrmt_callback_time_dist[TIME_DIST_BUCKETS_SIZE];
00049 extern int lkrmt_cache_callbacks;
00050 
00051 extern int cntlck_acquire_time_dist[TIME_DIST_BUCKETS_SIZE];
00052 extern int cntlck_acquire_events;
00053 
00054 extern int immediate_events_time_dist[TIME_DIST_BUCKETS_SIZE];
00055 extern int cnt_immediate_events;
00056 
00057 extern int inmsg_time_dist[TIME_DIST_BUCKETS_SIZE];
00058 extern int inmsg_events;
00059 
00060 extern int open_delay_time_dist[TIME_DIST_BUCKETS_SIZE];
00061 extern int open_delay_events;
00062 
00063 extern int cluster_send_time_dist[TIME_DIST_BUCKETS_SIZE];
00064 extern int cluster_send_events;
00065 #endif // ENABLE_TIME_TRACE
00066 
00067 #ifdef ENABLE_TIME_TRACE
00068 #define LOG_EVENT_TIME(_start_time, _time_dist, _time_cnt) do { \
00069   ink_hrtime now = ink_get_hrtime(); \
00070   unsigned int bucket = (now - _start_time) / HRTIME_MSECONDS(10); \
00071   if (bucket > TIME_DIST_BUCKETS) \
00072     bucket = TIME_DIST_BUCKETS; \
00073   ink_atomic_increment(&_time_dist[bucket], 1); \
00074   ink_atomic_increment(&_time_cnt, 1); \
00075 } while(0)
00076 
00077 #else // !ENABLE_TIME_TRACE
00078 #define LOG_EVENT_TIME(_start_time, _time_dist, _time_cnt)
00079 #endif // !ENABLE_TIME_TRACE
00080 
00081 #endif // _TimeTrace_h_
00082 
00083 // End of TimeTrace.h

Generated by  doxygen 1.7.1