1 /*
2  * Copyright (C) 2015-2018 Alibaba Group Holding Limited
3  */
4 
5 #ifndef __AWSS_BIND_STATIS_H__
6 #define __AWSS_BIND_STATIS_H__
7 
8 #ifndef AWSS_SUPPORT_DEV_BIND_STATIS
9 #define AWSS_SUPPORT_DEV_BIND_STATIS
10 #endif
11 
12 enum {
13     AWSS_DB_STATIS_START,
14     AWSS_DB_STATIS_SUC,
15 };
16 
17 #ifdef AWSS_SUPPORT_DEV_BIND_STATIS
18 struct awss_statis_dev_bind_t {
19     uint32_t dev_bind_cnt;       /* the count of token sync */
20     uint32_t dev_bind_suc;       /* the successful count of token sync */
21     uint32_t dev_bind_time_mean; /* the mean time of token sync */
22     uint32_t dev_bind_time_max;  /* the max time of token sync */
23     uint32_t dev_bind_time_min;  /* the min time of token sync */
24     uint32_t dev_bind_start;     /* the start time to sync token */
25     uint32_t dev_bind_end;       /* the end time of token sync */
26 };                               /* statistics for token sync */
27 
28 int awss_bind_report_statis(const char *module);
29 void awss_bind_update_statis(int type);
30 void awss_bind_clear_statis();
31 void awss_bind_disp_statis();
32 
33 #define AWSS_DB_UPDATE_STATIS(type) awss_bind_update_statis(type)
34 #define AWSS_DB_DISP_STATIS()       awss_bind_disp_statis()
35 #define AWSS_DB_CLEAR_STATIS()      awss_bind_clear_statis()
36 #define AWSS_DB_REPORT_STATIS(m)    awss_bind_report_statis(m)
37 #else
38 #define AWSS_DB_UPDATE_STATIS(type)
39 #define AWSS_DB_DISP_STATIS()
40 #define AWSS_DB_CLEAR_STATIS()
41 #define AWSS_DB_REPORT_STATIS(m)
42 #endif
43 #endif
44