Skip to content

Commit

Permalink
feat: add model definition (#26)
Browse files Browse the repository at this point in the history
Signed-off-by: wei <[email protected]>
  • Loading branch information
instpe authored Sep 1, 2024
1 parent ab23742 commit fe6735d
Show file tree
Hide file tree
Showing 8 changed files with 400 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.github.protocol.pulsar.admin.jdk;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class CompactionStats {
public long lastCompactionRemovedEventCount;

public long lastCompactionSucceedTimestamp;

public long lastCompactionFailedTimestamp;

public long lastCompactionDurationTimeInMills;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package io.github.protocol.pulsar.admin.jdk;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.util.List;
import java.util.Map;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class ConsumerStats {
public double msgRateOut;

public double msgThroughputOut;

public long bytesOutCounter;

public long msgOutCounter;

public double msgRateRedeLiver;

public double messageAckRate;

public int chunkedMessageRate;

public String consumerName;

public int availablePermits;

public long unackedMessages;

public int avgMessagesPerEntry;

public boolean blockedConsumerOnUnackedMsgs;

public String readPositionWhenJoining;

@JsonIgnore
private int addressOffset = -1;

@JsonIgnore
private int addressLength;

@JsonIgnore
private int connectedSinceOffset = -1;

@JsonIgnore
private int connectedSinceLength;

@JsonIgnore
private int clientVersionOffset = -1;

@JsonIgnore
private int clientVersionLength;

public long lastAckedTimestamp;

public long lastConsumedTimestamp;

public long lastConsumedFlowTimestamp;

public List<String> keyHashRanges;

public Map<String, String> metadata;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.github.protocol.pulsar.admin.jdk;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.util.Map;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class PartitionedTopicStats extends TopicStats{

public PartitionedTopicMetadata metadata;

public Map<String, TopicStats> partitions;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package io.github.protocol.pulsar.admin.jdk;

public enum ProducerAccessMode {
Shared,
Exclusive,
ExclusiveWithFencing,
WaitForExclusive;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package io.github.protocol.pulsar.admin.jdk;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.util.Map;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class PublisherStats {
@JsonIgnore
private int count;

public ProducerAccessMode accessMode;

public double msgRateIn;

public double msgThroughputIn;

public double averageMsgSize;

public double chunkedMessageRate;

public long producerId;

public boolean supportsPartialProducer;

@JsonIgnore
private int producerNameOffset = -1;

@JsonIgnore
private int producerNameLength;

@JsonIgnore
private int addressOffset = -1;

@JsonIgnore
private int addressLength;

@JsonIgnore
private int connectedSinceOffset = -1;

@JsonIgnore
private int connectedSinceLength;

@JsonIgnore
private int clientVersionOffset = -1;

@JsonIgnore
private int clientVersionLength;

@JsonIgnore
private StringBuilder stringBuilder = new StringBuilder();

public Map<String, String> metadata;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package io.github.protocol.pulsar.admin.jdk;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class ReplicatorStats {
public double msgRateIn;

public double msgThroughputIn;

public double msgRateOut;

public double msgThroughputOut;

public double msgRateExpired;

public long replicationBacklog;

public boolean connected;

public long replicationDelayInSeconds;

public String inboundConnection;

public String inboundConnectedSince;

public String outboundConnection;

public String outboundConnectedSince;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package io.github.protocol.pulsar.admin.jdk;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class SubscriptionStats {
public double msgRateOut;

public double msgThroughputOut;

public long bytesOutCounter;

public long msgOutCounter;

public double msgRateRedeLiver;

public double messageAckRate;

public int chunkedMessageRate;

public int msgBacklog;

public long backlogSize;

public long earliestMsgPublishTimeInBacklog;

public long msgBacklogNoDelayed;

public boolean blockedSubscriptionOnUnackedMsgs;

public boolean msgDelayed;

public long unackedMessages;

public String type;

public String activeConsumerName;

public double msgRateExpired;

public long totalMsgExpired;

public long lastExpireTimestamp;

public long lastConsumedFlowTimestamp;

public long lastConsumedTimestamp;

public long lastAckedTimestamp;

public long lastMarkDeleteAdvancedTimestamp;

public List<ConsumerStats> consumers = new ArrayList();

public boolean isDurable;

public boolean isReplicated;

public boolean allowOutOfOrderDelivery;

public String keySharedMode;

public Map<String, String> consumesAfterMarkDeletePosition = new LinkedHashMap();

public int nonContiguousDeletedMessagesRanges;

public int nonContiguousDeletedMessagesRangesSerializedSize;

public long delayedTrackerMemoryUsage;

public Map<String, String> subsriptionProperties = new HashMap<>();

public long filterProcessedMsgCount;

public long filterAcceptedMsgCount;

public long filterRejectedMsgCount;

public long filterRescheduledMsgCount;
}
Loading

0 comments on commit fe6735d

Please sign in to comment.