summaryrefslogtreecommitdiff
path: root/plugin/business/doh
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2024-11-13 14:09:03 +0800
committerluwenpeng <[email protected]>2024-11-13 17:17:13 +0800
commit3d99178958d99a2ee6a7c94c58ae8f7479ea1e2a (patch)
treeea880387c3d13d34a7e0e73f9a7ff48521a42b0e /plugin/business/doh
parentaa98cf915e965203479dec7ab7d231edd8301384 (diff)
TSG-23378 TFE移除平台层的FieldStat2,为适配AArch64做准备
Diffstat (limited to 'plugin/business/doh')
-rw-r--r--plugin/business/doh/src/doh.cpp9
-rw-r--r--plugin/business/doh/src/pub.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/plugin/business/doh/src/doh.cpp b/plugin/business/doh/src/doh.cpp
index a8d32e8..49f8ad5 100644
--- a/plugin/business/doh/src/doh.cpp
+++ b/plugin/business/doh/src/doh.cpp
@@ -391,11 +391,10 @@ static void doh_maat_scan(const struct tfe_stream *stream, const struct tfe_http
static void doh_gc_cb(evutil_socket_t fd, short what, void *arg)
{
- int i = 0;
-
- for (i = 0; i < DOH_STAT_MAX; i++)
+ for (int i = 0; i < DOH_STAT_MAX; i++)
{
- FS_operate(g_doh_conf->fs_handle, g_doh_conf->fs_id[i], 0, FS_OP_SET, ATOMIC_READ(&(g_doh_conf->stat_val[i])));
+ long long delta = ATOMIC_EXCHANGE(&(g_doh_conf->stat_val[i]), 0);
+ fieldstat_easy_counter_incrby(g_doh_conf->fs_handle, 0, g_doh_conf->fs_id[i], NULL, 0, delta);
}
}
@@ -413,7 +412,7 @@ static int doh_field_init()
{
if (spec[i] != NULL)
{
- g_doh_conf->fs_id[i] = FS_register(g_doh_conf->fs_handle, FS_STYLE_FIELD, FS_CALC_CURRENT, spec[i]);
+ g_doh_conf->fs_id[i] = fieldstat_easy_register_counter(g_doh_conf->fs_handle, spec[i]);
}
}
g_doh_conf->gcev = event_new(g_doh_conf->gc_evbase, -1, EV_PERSIST, doh_gc_cb, NULL);
diff --git a/plugin/business/doh/src/pub.h b/plugin/business/doh/src/pub.h
index 1b19dbf..54cc160 100644
--- a/plugin/business/doh/src/pub.h
+++ b/plugin/business/doh/src/pub.h
@@ -56,7 +56,7 @@ struct doh_conf
long long stat_val[DOH_STAT_MAX];
struct event *gcev;
struct event_base *gc_evbase;
- screen_stat_handle_t fs_handle;
+ struct fieldstat_easy *fs_handle;
struct maat *maat;
};