pulsar-client-cpp
Loading...
Searching...
No Matches
BrokerConsumerStats.h
1
19#ifndef PULSAR_CPP_BROKERCONSUMERSTATS_H
20#define PULSAR_CPP_BROKERCONSUMERSTATS_H
21
22#include <pulsar/ConsumerType.h>
23#include <pulsar/Result.h>
24#include <pulsar/defines.h>
25
26#include <functional>
27#include <iostream>
28#include <memory>
29
30namespace pulsar {
31class BrokerConsumerStatsImplBase;
32class PulsarWrapper;
33
34/* @note: isValid() or getXXX() methods are not allowed on an invalid BrokerConsumerStats */
35class PULSAR_PUBLIC BrokerConsumerStats {
36 private:
37 std::shared_ptr<BrokerConsumerStatsImplBase> impl_;
38
39 public:
40 BrokerConsumerStats() = default;
41 explicit BrokerConsumerStats(std::shared_ptr<BrokerConsumerStatsImplBase> impl);
42
43 virtual ~BrokerConsumerStats() = default;
44
46 virtual bool isValid() const;
47
49 virtual double getMsgRateOut() const;
50
52 virtual double getMsgThroughputOut() const;
53
55 virtual double getMsgRateRedeliver() const;
56
58 virtual const std::string getConsumerName() const;
59
61 virtual uint64_t getAvailablePermits() const;
62
64 virtual uint64_t getUnackedMessages() const;
65
67 virtual bool isBlockedConsumerOnUnackedMsgs() const;
68
70 virtual const std::string getAddress() const;
71
73 virtual const std::string getConnectedSince() const;
74
76 virtual const ConsumerType getType() const;
77
79 virtual double getMsgRateExpired() const;
80
82 virtual uint64_t getMsgBacklog() const;
83
85 std::shared_ptr<BrokerConsumerStatsImplBase> getImpl() const;
86
87 friend class PulsarWrapper;
88 friend PULSAR_PUBLIC std::ostream &operator<<(std::ostream &os, const BrokerConsumerStats &obj);
89};
90typedef std::function<void(Result result, BrokerConsumerStats brokerConsumerStats)>
91 BrokerConsumerStatsCallback;
92} // namespace pulsar
93
94#endif // PULSAR_CPP_BROKERCONSUMERSTATS_H
Definition BrokerConsumerStats.h:35
virtual double getMsgRateOut() const
virtual uint64_t getAvailablePermits() const
virtual const std::string getConsumerName() const
std::shared_ptr< BrokerConsumerStatsImplBase > getImpl() const
virtual const ConsumerType getType() const
virtual uint64_t getMsgBacklog() const
virtual bool isValid() const
virtual const std::string getAddress() const
virtual double getMsgThroughputOut() const
virtual const std::string getConnectedSince() const
virtual double getMsgRateExpired() const
virtual bool isBlockedConsumerOnUnackedMsgs() const
virtual uint64_t getUnackedMessages() const
virtual double getMsgRateRedeliver() const
Definition Authentication.h:31
ConsumerType
Definition ConsumerType.h:24
Result
Definition Result.h:32