mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 22:49:03 +08:00
feat: changed start and end time logic for consumer lag details (#6605)
This commit is contained in:
parent
67e822e23e
commit
7405bfbbee
@ -24,13 +24,13 @@ const MQServiceDetailTypePerView = (
|
|||||||
producerLatencyOption: ProducerLatencyOptions,
|
producerLatencyOption: ProducerLatencyOptions,
|
||||||
): Record<string, MessagingQueueServiceDetailType[]> => ({
|
): Record<string, MessagingQueueServiceDetailType[]> => ({
|
||||||
[MessagingQueuesViewType.consumerLag.value]: [
|
[MessagingQueuesViewType.consumerLag.value]: [
|
||||||
MessagingQueueServiceDetailType.ConsumerDetails,
|
|
||||||
MessagingQueueServiceDetailType.ProducerDetails,
|
MessagingQueueServiceDetailType.ProducerDetails,
|
||||||
|
MessagingQueueServiceDetailType.ConsumerDetails,
|
||||||
MessagingQueueServiceDetailType.NetworkLatency,
|
MessagingQueueServiceDetailType.NetworkLatency,
|
||||||
],
|
],
|
||||||
[MessagingQueuesViewType.partitionLatency.value]: [
|
[MessagingQueuesViewType.partitionLatency.value]: [
|
||||||
MessagingQueueServiceDetailType.ConsumerDetails,
|
|
||||||
MessagingQueueServiceDetailType.ProducerDetails,
|
MessagingQueueServiceDetailType.ProducerDetails,
|
||||||
|
MessagingQueueServiceDetailType.ConsumerDetails,
|
||||||
],
|
],
|
||||||
[MessagingQueuesViewType.producerLatency.value]: [
|
[MessagingQueuesViewType.producerLatency.value]: [
|
||||||
producerLatencyOption === ProducerLatencyOptions.Consumers
|
producerLatencyOption === ProducerLatencyOptions.Consumers
|
||||||
@ -122,7 +122,7 @@ function MessagingQueuesDetails({
|
|||||||
producerLatencyOption: ProducerLatencyOptions;
|
producerLatencyOption: ProducerLatencyOptions;
|
||||||
}): JSX.Element {
|
}): JSX.Element {
|
||||||
const [currentTab, setCurrentTab] = useState<MessagingQueueServiceDetailType>(
|
const [currentTab, setCurrentTab] = useState<MessagingQueueServiceDetailType>(
|
||||||
MessagingQueueServiceDetailType.ConsumerDetails,
|
MessagingQueueServiceDetailType.ProducerDetails,
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -179,10 +179,13 @@ export const convertToNanoseconds = (timestamp: number): bigint =>
|
|||||||
export const getStartAndEndTimesInMilliseconds = (
|
export const getStartAndEndTimesInMilliseconds = (
|
||||||
timestamp: number,
|
timestamp: number,
|
||||||
): { start: number; end: number } => {
|
): { start: number; end: number } => {
|
||||||
const FIVE_MINUTES_IN_MILLISECONDS = 5 * 60 * 1000; // 5 minutes in milliseconds - check with Shivanshu once
|
const FIVE_MINUTES_IN_MILLISECONDS = 5 * 60 * 1000; // 300,000 milliseconds
|
||||||
|
|
||||||
const start = Math.floor(timestamp);
|
const pointInTime = Math.floor(timestamp * 1000);
|
||||||
const end = Math.floor(start + FIVE_MINUTES_IN_MILLISECONDS);
|
|
||||||
|
// Convert timestamp to milliseconds and floor it
|
||||||
|
const start = Math.floor(pointInTime - FIVE_MINUTES_IN_MILLISECONDS);
|
||||||
|
const end = Math.floor(pointInTime + FIVE_MINUTES_IN_MILLISECONDS);
|
||||||
|
|
||||||
return { start, end };
|
return { start, end };
|
||||||
};
|
};
|
||||||
@ -311,8 +314,8 @@ export const getMetaDataAndAPIPerView = (
|
|||||||
return {
|
return {
|
||||||
[MessagingQueuesViewType.consumerLag.value]: {
|
[MessagingQueuesViewType.consumerLag.value]: {
|
||||||
tableApiPayload: {
|
tableApiPayload: {
|
||||||
start: (selectedTimelineQuery?.start || 0) * 1e9,
|
start: (selectedTimelineQuery?.start || 0) * 1e6,
|
||||||
end: (selectedTimelineQuery?.end || 0) * 1e9,
|
end: (selectedTimelineQuery?.end || 0) * 1e6,
|
||||||
variables: {
|
variables: {
|
||||||
partition: selectedTimelineQuery?.partition,
|
partition: selectedTimelineQuery?.partition,
|
||||||
topic: selectedTimelineQuery?.topic,
|
topic: selectedTimelineQuery?.topic,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user