From 194eaef323ab5d4225ec10bf45e4a8b10327227f Mon Sep 17 00:00:00 2001 From: SpaceOneT <375808041@qq.com> Date: Sat, 8 Jun 2024 08:40:18 +0000 Subject: [PATCH] =?UTF-8?q?[ISSUE=20#447]=E2=9C=A8=20Add=20stats?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rocketmq-common/src/common.rs | 1 + rocketmq-common/src/common/stats.rs | 47 +++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 rocketmq-common/src/common/stats.rs diff --git a/rocketmq-common/src/common.rs b/rocketmq-common/src/common.rs index 339df3df..4967239a 100644 --- a/rocketmq-common/src/common.rs +++ b/rocketmq-common/src/common.rs @@ -40,6 +40,7 @@ pub mod mix_all; pub mod mq_version; pub mod namesrv; pub mod server; +pub mod stats; pub mod sys_flag; pub mod thread; pub mod topic; diff --git a/rocketmq-common/src/common/stats.rs b/rocketmq-common/src/common/stats.rs new file mode 100644 index 00000000..a8a3282c --- /dev/null +++ b/rocketmq-common/src/common/stats.rs @@ -0,0 +1,47 @@ +/* + * 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. + */ + +pub struct Stats; + +impl Stats { + pub const QUEUE_PUT_NUMS: &'static str = "QUEUE_PUT_NUMS"; + pub const QUEUE_PUT_SIZE: &'static str = "QUEUE_PUT_SIZE"; + pub const QUEUE_GET_NUMS: &'static str = "QUEUE_GET_NUMS"; + pub const QUEUE_GET_SIZE: &'static str = "QUEUE_GET_SIZE"; + pub const TOPIC_PUT_NUMS: &'static str = "TOPIC_PUT_NUMS"; + pub const TOPIC_PUT_SIZE: &'static str = "TOPIC_PUT_SIZE"; + pub const GROUP_GET_NUMS: &'static str = "GROUP_GET_NUMS"; + pub const GROUP_GET_SIZE: &'static str = "GROUP_GET_SIZE"; + pub const SNDBCK_PUT_NUMS: &'static str = "SNDBCK_PUT_NUMS"; + pub const BROKER_PUT_NUMS: &'static str = "BROKER_PUT_NUMS"; + pub const BROKER_GET_NUMS: &'static str = "BROKER_GET_NUMS"; + pub const GROUP_GET_FROM_DISK_NUMS: &'static str = "GROUP_GET_FROM_DISK_NUMS"; + pub const GROUP_GET_FROM_DISK_SIZE: &'static str = "GROUP_GET_FROM_DISK_SIZE"; + pub const BROKER_GET_FROM_DISK_NUMS: &'static str = "BROKER_GET_FROM_DISK_NUMS"; + pub const BROKER_GET_FROM_DISK_SIZE: &'static str = "BROKER_GET_FROM_DISK_SIZE"; + pub const COMMERCIAL_SEND_TIMES: &'static str = "COMMERCIAL_SEND_TIMES"; + pub const COMMERCIAL_SNDBCK_TIMES: &'static str = "COMMERCIAL_SNDBCK_TIMES"; + pub const COMMERCIAL_RCV_TIMES: &'static str = "COMMERCIAL_RCV_TIMES"; + pub const COMMERCIAL_RCV_EPOLLS: &'static str = "COMMERCIAL_RCV_EPOLLS"; + pub const COMMERCIAL_SEND_SIZE: &'static str = "COMMERCIAL_SEND_SIZE"; + pub const COMMERCIAL_RCV_SIZE: &'static str = "COMMERCIAL_RCV_SIZE"; + pub const COMMERCIAL_PERM_FAILURES: &'static str = "COMMERCIAL_PERM_FAILURES"; + + pub const GROUP_GET_FALL_SIZE: &'static str = "GROUP_GET_FALL_SIZE"; + pub const GROUP_GET_FALL_TIME: &'static str = "GROUP_GET_FALL_TIME"; + pub const GROUP_GET_LATENCY: &'static str = "GROUP_GET_LATENCY"; +}