rocketmq_remoting/protocol/body/
process_queue_info.rs

1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#[derive(Debug, Clone, Copy)]
19pub struct ProcessQueueInfo {
20    pub commit_offset: u64,
21    pub cached_msg_min_offset: u64,
22    pub cached_msg_max_offset: u64,
23    pub cached_msg_count: u32,
24    pub cached_msg_size_in_mib: u32,
25
26    pub transaction_msg_min_offset: u64,
27    pub transaction_msg_max_offset: u64,
28    pub transaction_msg_count: u32,
29
30    pub locked: bool,
31    pub try_unlock_times: u64,
32    pub last_lock_timestamp: u64,
33
34    pub droped: bool,
35    pub last_pull_timestamp: u64,
36    pub last_consume_timestamp: u64,
37}
38
39impl std::fmt::Display for ProcessQueueInfo {
40    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
41        write!(
42            f,
43            "ProcessQueueInfo [commit_offset: {}, cached_msg_min_offset: {}, \
44             cached_msg_max_offset: {}, cached_msg_count: {}, cached_msg_size_in_mib: {}, \
45             transaction_msg_min_offset: {}, transaction_msg_max_offset: {}, \
46             transaction_msg_count: {}, locked: {}, try_unlock_times: {}, last_lock_timestamp: \
47             {}, droped: {}, last_pull_timestamp: {}, last_consume_timestamp: {}]",
48            self.commit_offset,
49            self.cached_msg_min_offset,
50            self.cached_msg_max_offset,
51            self.cached_msg_count,
52            self.cached_msg_size_in_mib,
53            self.transaction_msg_min_offset,
54            self.transaction_msg_max_offset,
55            self.transaction_msg_count,
56            self.locked,
57            self.try_unlock_times,
58            self.last_lock_timestamp,
59            self.droped,
60            self.last_pull_timestamp,
61            self.last_consume_timestamp
62        )
63    }
64}