2024-11-05 19:26:41 +05:30
|
|
|
import axios from 'api';
|
|
|
|
|
import { ErrorResponse, SuccessResponse } from 'types/api';
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
MessagingQueueServicePayload,
|
|
|
|
|
MessagingQueuesPayloadProps,
|
|
|
|
|
} from './getConsumerLagDetails';
|
|
|
|
|
|
|
|
|
|
export const getTopicThroughputDetails = async (
|
|
|
|
|
props: MessagingQueueServicePayload,
|
|
|
|
|
): Promise<
|
|
|
|
|
SuccessResponse<MessagingQueuesPayloadProps['payload']> | ErrorResponse
|
|
|
|
|
> => {
|
|
|
|
|
const { detailType, ...rest } = props;
|
|
|
|
|
const endpoint = `/messaging-queues/kafka/topic-throughput/${detailType}`;
|
2024-11-06 14:24:38 +05:30
|
|
|
const response = await axios.post(endpoint, {
|
|
|
|
|
...rest,
|
|
|
|
|
});
|
2024-11-05 19:26:41 +05:30
|
|
|
|
2024-11-06 14:24:38 +05:30
|
|
|
return {
|
|
|
|
|
statusCode: 200,
|
|
|
|
|
error: null,
|
|
|
|
|
message: response.data.status,
|
|
|
|
|
payload: response.data.data,
|
|
|
|
|
};
|
2024-11-05 19:26:41 +05:30
|
|
|
};
|