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

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  ****************************************************************************/
00031 
00032 #ifndef _TimeTrace_h_
00033 #define _TimeTrace_h_
00034 
00035 // #define ENABLE_TIME_TRACE
00036 
00037 #define TIME_DIST_BUCKETS               500
00038 #define TIME_DIST_BUCKETS_SIZE          TIME_DIST_BUCKETS+1
00039 
00040 #ifdef ENABLE_TIME_TRACE
00041 extern int cdb_callback_time_dist[TIME_DIST_BUCKETS_SIZE];
00042 extern int cdb_cache_callbacks;
00043 
00044 extern int callback_time_dist[TIME_DIST_BUCKETS_SIZE];
00045 extern int cache_callbacks;
00046 
00047 extern int rmt_callback_time_dist[TIME_DIST_BUCKETS_SIZE];
00048 extern int rmt_cache_callbacks;
00049 
00050 extern int lkrmt_callback_time_dist[TIME_DIST_BUCKETS_SIZE];
00051 extern int lkrmt_cache_callbacks;
00052 
00053 extern int cntlck_acquire_time_dist[TIME_DIST_BUCKETS_SIZE];
00054 extern int cntlck_acquire_events;
00055 
00056 extern int immediate_events_time_dist[TIME_DIST_BUCKETS_SIZE];
00057 extern int cnt_immediate_events;
00058 
00059 extern int inmsg_time_dist[TIME_DIST_BUCKETS_SIZE];
00060 extern int inmsg_events;
00061 
00062 extern int open_delay_time_dist[TIME_DIST_BUCKETS_SIZE];
00063 extern int open_delay_events;
00064 
00065 extern int cluster_send_time_dist[TIME_DIST_BUCKETS_SIZE];
00066 extern int cluster_send_events;
00067 #endif // ENABLE_TIME_TRACE
00068 
00069 #ifdef ENABLE_TIME_TRACE
00070 #define LOG_EVENT_TIME(_start_time, _time_dist, _time_cnt) do { \
00071   ink_hrtime now = ink_get_hrtime(); \
00072   unsigned int bucket = (now - _start_time) / HRTIME_MSECONDS(10); \
00073   if (bucket > TIME_DIST_BUCKETS) \
00074     bucket = TIME_DIST_BUCKETS; \
00075   ink_atomic_increment(&_time_dist[bucket], 1); \
00076   ink_atomic_increment(&_time_cnt, 1); \
00077 } while(0)
00078 
00079 #else // !ENABLE_TIME_TRACE
00080 #define LOG_EVENT_TIME(_start_time, _time_dist, _time_cnt)
00081 #endif // !ENABLE_TIME_TRACE
00082 
00083 #endif // _TimeTrace_h_
00084 
00085 // End of TimeTrace.h

Generated by  doxygen 1.7.1