Data Structures | Defines | Typedefs | Functions | Variables

StatSystem.h File Reference

A brief file description. More...

#include "ink_platform.h"
#include "ink_hrtime.h"
#include "ink_atomic.h"
#include "ink_apidefs.h"
#include "HttpTransStats.h"
#include "DynamicStats.h"
Include dependency graph for StatSystem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  TransactionMilestones
struct  HttpTransactionStatsString_t
struct  DynamicStatsString_t
struct  ink_local_stat_t
struct  ink_prot_global_stat_t
struct  ink_unprot_global_stat_t

Defines

#define STATS_MAJOR_VERSION   6
#define DEFAULT_SNAP_FILENAME   "stats.snap"
#define _HEADER
#define _FOOTER
#define _D(_x)   _x,
#define DYN_STAT_START   2048
#define DYN_STAT_MASK   (~(2047UL))
#define _HEADER
#define _FOOTER
#define _D(_x)   _x,
#define ink_stat_lock_t   ink_mutex
#define CLEAR_DYN_STAT(X)
#define DECREMENT_DYN_STAT(X)   SUM_DYN_STAT(X, (ink_statval_t)-1)
#define COUNT_DYN_STAT(X, C)
#define FSUM_DYN_STAT(X, S)
#define INCREMENT_DYN_STAT(X)   SUM_DYN_STAT(X, (ink_statval_t)1)
#define READ_DYN_STAT(X, C, S)
#define READ_DYN_COUNT(X, C)
#define READ_DYN_SUM(X, S)
#define SET_DYN_COUNT(X, V)
#define SET_DYN_STAT(X, C, S)
#define SUM_DYN_STAT(X, S)
#define SUM_GLOBAL_DYN_STAT(X, S)
#define __CLEAR_TRANS_STAT(local_stat_struct_, X)
#define __DECREMENT_TRANS_STAT(local_stat_struct_, X)   __SUM_TRANS_STAT(local_stat_struct_, X, (ink_statval_t)-1)
#define __FSUM_TRANS_STAT(local_stat_struct_, X, S)
#define __INCREMENT_TRANS_STAT(local_stat_struct_, X)   __SUM_TRANS_STAT(local_stat_struct_, X, (ink_statval_t)1);
#define __INITIALIZE_LOCAL_STAT_STRUCT(local_stat_struct_, X)   __CLEAR_TRANS_STAT(local_stat_struct_, X)
#define INITIALIZE_GLOBAL_TRANS_STATS(X)
#define READ_HTTP_TRANS_STAT(X, C, S)
#define __SET_TRANS_COUNT(local_stat_struct_, X, V)
#define __SET_TRANS_STAT(local_stat_struct_, X, C, S)
#define __SUM_TRANS_STAT(local_stat_struct_, X, S)
#define UPDATE_HTTP_TRANS_STATS(local_stat_struct_)
#define STAT_LOCK_ACQUIRE(X)   (ink_mutex_acquire(X))
#define STAT_LOCK_RELEASE(X)   (ink_mutex_release(X))
#define STAT_LOCK_INIT(X, S)   (ink_mutex_init(X,S))
#define ADD_TO_GLOBAL_DYN_COUNT(X, C)   ink_atomic_increment(&global_dyn_stats[X].count,C)
#define ADD_TO_GLOBAL_DYN_SUM(X, S)
#define ADD_TO_GLOBAL_GLOBAL_DYN_SUM(X, S)
#define ADD_TO_GLOBAL_DYN_FSUM(X, S)
#define CLEAR_GLOBAL_DYN_STAT(X)
#define READ_GLOBAL_DYN_STAT(X, C, S)
#define READ_GLOBAL_DYN_COUNT(X, C)   C = global_dyn_stats[X].count;
#define READ_GLOBAL_DYN_SUM(X, S)   S = global_dyn_stats[X].sum;
#define READ_GLOBAL_HTTP_TRANS_STAT(X, C, S)
#define SET_GLOBAL_DYN_COUNT(X, V)   global_dyn_stats[X].count = V
#define SET_GLOBAL_DYN_STAT(X, C, S)
#define INITIALIZE_GLOBAL_DYN_STATS(X, T)
#define MAX_HTTP_HANDLER_EVENTS   25

Typedefs

typedef int64_t ink_statval_t

Functions

void start_stats_snap (void)
void initialize_all_global_stats ()
void * http_trans_stats_count_cb (void *data, void *res)
void * http_trans_stats_sum_cb (void *data, void *res)
void * http_trans_stats_avg_cb (void *data, void *res)
void * http_trans_stats_fsum_cb (void *data, void *res)
void * http_trans_stats_favg_cb (void *data, void *res)
void * http_trans_stats_time_seconds_cb (void *data, void *res)
void * http_trans_stats_time_mseconds_cb (void *data, void *res)
void * http_trans_stats_time_useconds_cb (void *data, void *res)
void * dyn_stats_count_cb (void *data, void *res)
inkcoreapi void * dyn_stats_sum_cb (void *data, void *res)
void * dyn_stats_avg_cb (void *data, void *res)
void * dyn_stats_fsum_cb (void *data, void *res)
void * dyn_stats_favg_cb (void *data, void *res)
void * dyn_stats_time_seconds_cb (void *data, void *res)
void * dyn_stats_time_mseconds_cb (void *data, void *res)
void * dyn_stats_time_useconds_cb (void *data, void *res)
void * dyn_stats_int_msecs_to_float_seconds_cb (void *data, void *res)
void clear_http_handler_times ()
void print_http_handler_time (int event)
void print_all_http_handler_times ()

Variables

HttpTransactionStatsString_t HttpTransactionStatsStrings []
DynamicStatsString_t DynamicStatsStrings []
ink_stat_lock_t global_http_trans_stat_lock
ink_unprot_global_stat_t global_http_trans_stats [MAX_HTTP_TRANS_STATS]
inkcoreapi ink_unprot_global_stat_t global_dyn_stats [MAX_DYN_STATS-DYN_STAT_START]

Detailed Description

A brief file description.

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file StatSystem.h.


Define Documentation

#define __CLEAR_TRANS_STAT (   local_stat_struct_,
  X 
)
Value:
{ \
    ink_assert (!(X & DYN_STAT_MASK)); \
    local_stat_struct_[X].count = (ink_statval_t)0; \
    local_stat_struct_[X].value = (ink_statval_t)0; \
}

Definition at line 297 of file StatSystem.h.

#define __DECREMENT_TRANS_STAT (   local_stat_struct_,
  X 
)    __SUM_TRANS_STAT(local_stat_struct_, X, (ink_statval_t)-1)

Definition at line 304 of file StatSystem.h.

#define __FSUM_TRANS_STAT (   local_stat_struct_,
  X,
  S 
)
Value:
{ \
    ink_assert (!(X & DYN_STAT_MASK)); \
    local_stat_struct_[X].count++; \
    (*(double *)&local_stat_struct_[X].value) += S; \
}

Definition at line 306 of file StatSystem.h.

#define __INCREMENT_TRANS_STAT (   local_stat_struct_,
  X 
)    __SUM_TRANS_STAT(local_stat_struct_, X, (ink_statval_t)1);

Definition at line 314 of file StatSystem.h.

#define __INITIALIZE_LOCAL_STAT_STRUCT (   local_stat_struct_,
  X 
)    __CLEAR_TRANS_STAT(local_stat_struct_, X)

Definition at line 316 of file StatSystem.h.

#define __SET_TRANS_COUNT (   local_stat_struct_,
  X,
  V 
)
Value:
{ \
    ink_assert (!(X & DYN_STAT_MASK)); \
    local_stat_struct_[X].value = (ink_statval_t)V; \
}

Definition at line 335 of file StatSystem.h.

#define __SET_TRANS_STAT (   local_stat_struct_,
  X,
  C,
  S 
)
Value:
{ \
    ink_assert (!(X & DYN_STAT_MASK)); \
    local_stat_struct_[X].value = (ink_statval_t)S; \
}

Definition at line 342 of file StatSystem.h.

#define __SUM_TRANS_STAT (   local_stat_struct_,
  X,
  S 
)
Value:
{ \
    ink_assert (!(X & DYN_STAT_MASK)); \
    local_stat_struct_[X].count += 1; \
    local_stat_struct_[X].value += S; \
}

Definition at line 351 of file StatSystem.h.

#define _D (   _x  )     _x,

Definition at line 164 of file StatSystem.h.

#define _D (   _x  )     _x,

Definition at line 164 of file StatSystem.h.

#define _FOOTER
Value:
MAX_DYN_STATS \
} DynamicStat_t;

Definition at line 160 of file StatSystem.h.

#define _FOOTER
Value:
MAX_HTTP_TRANS_STATS \
} HttpTransactionStat_t;

Definition at line 160 of file StatSystem.h.

#define _HEADER
Value:
typedef enum { \
    NO_DYN_STATS = DYN_STAT_START,

Definition at line 156 of file StatSystem.h.

#define _HEADER
Value:
typedef enum { \
    NO_HTTP_TRANS_STATS = 0,

Definition at line 156 of file StatSystem.h.

#define ADD_TO_GLOBAL_DYN_COUNT (   X,
  C 
)    ink_atomic_increment(&global_dyn_stats[X].count,C)

Definition at line 460 of file StatSystem.h.

#define ADD_TO_GLOBAL_DYN_FSUM (   X,
  S 
)
Value:
ink_atomic_increment(&global_dyn_stats[X].count,(ink_statval_t)1); \
(*(double *)&global_dyn_stats[X].sum) += S

Definition at line 471 of file StatSystem.h.

#define ADD_TO_GLOBAL_DYN_SUM (   X,
  S 
)
Value:
ink_atomic_increment(&global_dyn_stats[X].count,(ink_statval_t)1); \
ink_atomic_increment(&global_dyn_stats[X].sum,S)

Definition at line 463 of file StatSystem.h.

#define ADD_TO_GLOBAL_GLOBAL_DYN_SUM (   X,
  S 
)
Value:
ink_atomic_increment(&global_dyn_stats[X].count,(ink_statval_t)1); \
ink_atomic_increment(&global_dyn_stats[X].sum,S)

Definition at line 467 of file StatSystem.h.

#define CLEAR_DYN_STAT (   X  ) 
Value:

Definition at line 224 of file StatSystem.h.

#define CLEAR_GLOBAL_DYN_STAT (   X  ) 
Value:

Definition at line 475 of file StatSystem.h.

#define COUNT_DYN_STAT (   X,
  C 
)
Value:

Definition at line 232 of file StatSystem.h.

#define DECREMENT_DYN_STAT (   X  )     SUM_DYN_STAT(X, (ink_statval_t)-1)

Definition at line 230 of file StatSystem.h.

#define DEFAULT_SNAP_FILENAME   "stats.snap"

Definition at line 42 of file StatSystem.h.

#define DYN_STAT_MASK   (~(2047UL))

Definition at line 152 of file StatSystem.h.

#define DYN_STAT_START   2048

Definition at line 151 of file StatSystem.h.

#define FSUM_DYN_STAT (   X,
  S 
)
Value:

Definition at line 238 of file StatSystem.h.

#define INCREMENT_DYN_STAT (   X  )     SUM_DYN_STAT(X, (ink_statval_t)1)

Definition at line 245 of file StatSystem.h.

#define INITIALIZE_GLOBAL_DYN_STATS (   X,
  T 
)
Value:
{ \
    X.count = (ink_statval_t)0; \
    X.sum = (ink_statval_t)0; \
}

Definition at line 502 of file StatSystem.h.

Referenced by initialize_all_global_stats().

#define INITIALIZE_GLOBAL_TRANS_STATS (   X  ) 
Value:
{ \
    X.count = (ink_statval_t)0; \
    X.sum = (ink_statval_t)0; \
}

Definition at line 318 of file StatSystem.h.

Referenced by initialize_all_global_stats().

#define ink_stat_lock_t   ink_mutex

Definition at line 186 of file StatSystem.h.

#define MAX_HTTP_HANDLER_EVENTS   25

Definition at line 626 of file StatSystem.h.

#define READ_DYN_COUNT (   X,
  C 
)
Value:

Definition at line 257 of file StatSystem.h.

#define READ_DYN_STAT (   X,
  C,
  S 
)
#define READ_DYN_SUM (   X,
  S 
)
Value:

Definition at line 263 of file StatSystem.h.

#define READ_GLOBAL_DYN_COUNT (   X,
  C 
)    C = global_dyn_stats[X].count;

Definition at line 483 of file StatSystem.h.

#define READ_GLOBAL_DYN_STAT (   X,
  C,
  S 
)
Value:

Definition at line 479 of file StatSystem.h.

Referenced by write_stats_snap().

#define READ_GLOBAL_DYN_SUM (   X,
  S 
)    S = global_dyn_stats[X].sum;

Definition at line 486 of file StatSystem.h.

#define READ_GLOBAL_HTTP_TRANS_STAT (   X,
  C,
  S 
)
Value:

Definition at line 489 of file StatSystem.h.

#define READ_HTTP_TRANS_STAT (   X,
  C,
  S 
)
#define SET_DYN_COUNT (   X,
  V 
)
Value:

Definition at line 270 of file StatSystem.h.

#define SET_DYN_STAT (   X,
  C,
  S 
)
Value:

Definition at line 277 of file StatSystem.h.

#define SET_GLOBAL_DYN_COUNT (   X,
  V 
)    global_dyn_stats[X].count = V

Definition at line 495 of file StatSystem.h.

#define SET_GLOBAL_DYN_STAT (   X,
  C,
  S 
)
Value:

Definition at line 498 of file StatSystem.h.

#define STAT_LOCK_ACQUIRE (   X  )     (ink_mutex_acquire(X))
#define STAT_LOCK_INIT (   X,
  S 
)    (ink_mutex_init(X,S))

Definition at line 371 of file StatSystem.h.

Referenced by initialize_all_global_stats().

#define STAT_LOCK_RELEASE (   X  )     (ink_mutex_release(X))
#define STATS_MAJOR_VERSION   6

Definition at line 41 of file StatSystem.h.

#define SUM_DYN_STAT (   X,
  S 
)
Value:

Definition at line 284 of file StatSystem.h.

#define SUM_GLOBAL_DYN_STAT (   X,
  S 
)
Value:

Definition at line 291 of file StatSystem.h.

#define UPDATE_HTTP_TRANS_STATS (   local_stat_struct_  ) 
Value:
{ \
    int i; \
    STAT_LOCK_ACQUIRE(&(global_http_trans_stat_lock)); \
    for (i=NO_HTTP_TRANS_STATS; i<MAX_HTTP_TRANS_STATS; i++) { \
        global_http_trans_stats[i].count += local_stat_struct_[i].count; \
        global_http_trans_stats[i].sum += local_stat_struct_[i].value; \
    } \
    STAT_LOCK_RELEASE(&(global_http_trans_stat_lock)); \
}

Definition at line 358 of file StatSystem.h.


Typedef Documentation

typedef int64_t ink_statval_t

Definition at line 188 of file StatSystem.h.


Function Documentation

void clear_http_handler_times (  ) 

Definition at line 7306 of file HttpSM.cc.

Referenced by initialize_all_global_stats().

void* dyn_stats_avg_cb ( void *  data,
void *  res 
)

Definition at line 580 of file StatSystem.cc.

References READ_DYN_STAT.

void* dyn_stats_count_cb ( void *  data,
void *  res 
)

Definition at line 560 of file StatSystem.cc.

References READ_DYN_STAT.

void* dyn_stats_favg_cb ( void *  data,
void *  res 
)

Definition at line 603 of file StatSystem.cc.

References READ_DYN_STAT.

void* dyn_stats_fsum_cb ( void *  data,
void *  res 
)

Definition at line 593 of file StatSystem.cc.

References READ_DYN_STAT.

void* dyn_stats_int_msecs_to_float_seconds_cb ( void *  data,
void *  res 
)

Definition at line 544 of file StatSystem.cc.

References READ_DYN_STAT.

inkcoreapi void* dyn_stats_sum_cb ( void *  data,
void *  res 
)

Definition at line 570 of file StatSystem.cc.

References READ_DYN_STAT.

void* dyn_stats_time_mseconds_cb ( void *  data,
void *  res 
)

Definition at line 632 of file StatSystem.cc.

References HRTIME_MSECOND, and READ_DYN_STAT.

void* dyn_stats_time_seconds_cb ( void *  data,
void *  res 
)

Definition at line 616 of file StatSystem.cc.

References HRTIME_SECOND, and READ_DYN_STAT.

void* dyn_stats_time_useconds_cb ( void *  data,
void *  res 
)

Definition at line 648 of file StatSystem.cc.

References HRTIME_USECOND, and READ_DYN_STAT.

void* http_trans_stats_avg_cb ( void *  data,
void *  res 
)

Definition at line 703 of file StatSystem.cc.

References READ_HTTP_TRANS_STAT.

void* http_trans_stats_count_cb ( void *  data,
void *  res 
)

Definition at line 683 of file StatSystem.cc.

References READ_HTTP_TRANS_STAT.

void* http_trans_stats_favg_cb ( void *  data,
void *  res 
)

Definition at line 726 of file StatSystem.cc.

References READ_HTTP_TRANS_STAT.

void* http_trans_stats_fsum_cb ( void *  data,
void *  res 
)

Definition at line 716 of file StatSystem.cc.

References READ_HTTP_TRANS_STAT.

void* http_trans_stats_sum_cb ( void *  data,
void *  res 
)

Definition at line 693 of file StatSystem.cc.

References READ_HTTP_TRANS_STAT.

void* http_trans_stats_time_mseconds_cb ( void *  data,
void *  res 
)

Definition at line 755 of file StatSystem.cc.

References HRTIME_MSECOND, and READ_HTTP_TRANS_STAT.

void* http_trans_stats_time_seconds_cb ( void *  data,
void *  res 
)

Definition at line 739 of file StatSystem.cc.

References HRTIME_SECOND, and READ_HTTP_TRANS_STAT.

void* http_trans_stats_time_useconds_cb ( void *  data,
void *  res 
)

Definition at line 771 of file StatSystem.cc.

References HRTIME_USECOND, and READ_HTTP_TRANS_STAT.

void initialize_all_global_stats (  ) 
void print_all_http_handler_times (  ) 
void print_http_handler_time ( int  event  ) 
void start_stats_snap ( void   ) 

Variable Documentation

inkcoreapi ink_unprot_global_stat_t global_dyn_stats[MAX_DYN_STATS-DYN_STAT_START]
ink_stat_lock_t global_http_trans_stat_lock

Definition at line 51 of file StatSystem.cc.