81 #if defined(LWS_WITH_SYS_METRICS)
89 #define lws_metrics_tag_wsi_add(_a, _b, _c)
92 #if defined(LWS_WITH_SECURE_STREAMS)
97 #if defined(LWS_WITH_SYS_METRICS)
99 lws_metrics_tag_ss_add(
struct lws_ss_handle *ss,
const char *name,
const char *val);
101 #define lws_metrics_tag_ss_add(_a, _b, _c)
124 #define lws_metric_bucket_name_len(_b) (*((uint8_t *)&(_b)[1]))
125 #define lws_metric_bucket_name(_b) (((const char *)&(_b)[1]) + 1)
190 uint64_t total_count;
220 struct lws_metric *
mt;
224 #if defined(LWS_WITH_SYS_METRICS)
225 #define lws_metrics_caliper_compose(_name) \
226 lws_metric_caliper_t _name;
227 #define lws_metrics_caliper_bind(_name, _mt) \
229 lwsl_err("caliper: overwrite %s\n", \
230 lws_metrics_priv_to_pub(_name.mt)->name); \
232 _name.mt = _mt; _name.us_start = lws_now_usecs(); }
233 #define lws_metrics_caliper_declare(_name, _mt) \
234 lws_metric_caliper_t _name = { .mt = _mt, .us_start = lws_now_usecs() }
235 #define lws_metrics_caliper_report(_name, _go_nogo) \
236 { if (_name.us_start) { lws_metric_event(_name.mt, _go_nogo, \
237 (u_mt_t)(lws_now_usecs() - \
239 } lws_metrics_caliper_done(_name); }
240 #define lws_metrics_caliper_report_hist(_name, pwsi) if (_name.mt) { \
241 lws_metrics_hist_bump_priv_tagged(lws_metrics_priv_to_pub(_name.mt), \
242 &_name.mtags_owner, \
243 pwsi ? &((pwsi)->cal_conn.mtags_owner) : NULL); \
244 lws_metrics_caliper_done(_name); }
246 #define lws_metrics_caliper_cancel(_name) { lws_metrics_caliper_done(_name); }
247 #define lws_metrics_hist_bump(_mt, _name) \
248 lws_metrics_hist_bump_(_mt, _name)
249 #define lws_metrics_hist_bump_priv(_mt, _name) \
250 lws_metrics_hist_bump_(lws_metrics_priv_to_pub(_mt), _name)
251 #define lws_metrics_caliper_done(_name) { \
252 _name.us_start = 0; _name.mt = NULL; \
253 lws_metrics_tags_destroy(&_name.mtags_owner); }
255 #define lws_metrics_caliper_compose(_name)
256 #define lws_metrics_caliper_bind(_name, _mt)
257 #define lws_metrics_caliper_declare(_name, _mp)
258 #define lws_metrics_caliper_report(_name, _go_nogo)
259 #define lws_metrics_caliper_report_hist(_name, pwsiconn)
260 #define lws_metrics_caliper_cancel(_name)
261 #define lws_metrics_hist_bump(_mt, _name)
262 #define lws_metrics_hist_bump_priv(_mt, _name)
263 #define lws_metrics_caliper_done(_name)
283 char *buf,
size_t len);
327 #define METRES_NOGO 1
LWS_EXTERN LWS_VISIBLE const char * lws_metrics_tag_get(lws_dll2_owner_t *owner, const char *name)
struct lws_metric_bucket lws_metric_bucket_t
LWS_EXTERN LWS_VISIBLE int lws_metrics_hist_bump_(lws_metric_pub_t *pub, const char *name)
@ LWSMTFL_REPORT_OUTLIERS
@ LWSMTFL_REPORT_INACTIVITY_AT_PERIODIC
@ LWSMTFL_REPORT_DUTY_WALLCLOCK_US
LWS_EXTERN LWS_VISIBLE int lws_metrics_format(lws_metric_pub_t *pub, lws_metric_bucket_t **sub, char *buf, size_t len)
struct lws_metric_bucket * next
union lws_metric_pub::@24 u
LWS_EXTERN LWS_VISIBLE size_t lws_metrics_tags_serialize(lws_dll2_owner_t *owner, char *buf, size_t len)
struct lws_metrics_tag lws_metrics_tag_t
LWS_EXTERN LWS_VISIBLE void lws_metrics_tags_destroy(lws_dll2_owner_t *owner)
LWS_VISIBLE LWS_EXTERN int lws_metrics_foreach(struct lws_context *ctx, void *user, int(*cb)(lws_metric_pub_t *pub, void *user))
struct lws_metric_caliper lws_metric_caliper_t
LWS_EXTERN LWS_VISIBLE int lws_metrics_tag_add(lws_dll2_owner_t *owner, const char *name, const char *val)
struct lws_dll2_owner mtags_owner
struct lws_metric_pub lws_metric_pub_t
enum lws_metric_rpt lws_metric_rpt_kind_t
#define lws_metrics_tag_wsi_add(_a, _b, _c)
LWS_EXTERN LWS_VISIBLE void lws_metrics_hist_bump_priv_tagged(lws_metric_pub_t *mt, lws_dll2_owner_t *tow, lws_dll2_owner_t *tow2)
LWS_VISIBLE LWS_EXTERN int lws_metrics_hist_bump_describe_wsi(struct lws *wsi, lws_metric_pub_t *pub, const char *name)