fluvio icon indicating copy to clipboard operation
fluvio copied to clipboard

Improve fluvio topic describe with additional information

Open ajhunyady opened this issue 10 months ago • 8 comments

The current fluvio topic describe has been built 3 years ago and it's stale.

We should update this command with the following information:

$ fluvio topic describe my-topic
Name         : my-topic
Replication  : 1
Partitions   : 2 
State        : Provisioned

PARTITION    LEADER   LAST-OFFSET    LAST-PRODUCED   CONSUMERS
0            5001       3,543          1 sec ago       c1, c2
1            5002       1,240          5 sec ago       c3

Note

Let's start with the client approach, as calculating and adding a PartitionStatus object on the SC is a bigger effort.

  • To get last offset, use LEO (Last End Offset).
  • To get last produced, get last event and get timestamp of the event. This could be done in the client (easier) or can be
  • To get consumers, use fluvio consumer list as guidance.

ajhunyady avatar Apr 24 '24 23:04 ajhunyady

Hey @ajhunyady... With some delay, I started fixing this issue. I have two questions:

  1. I am assuming that LAST-OFFSET refers to status.leader.leo; Is that right?
  2. IDK which field to use to calculate LAST-PRODUCED.

TY

diogopontual avatar Sep 05 '24 13:09 diogopontual

@diogopontual very cool! @sehz can you please help with identify the right field?

ajhunyady avatar Sep 05 '24 14:09 ajhunyady

Confirm. To get last offset, use LEO (Last End Offset). To get last produced, get last event and get timestamp of the event. This could be done in the client (easier) or can be calculated in the SC (that's more restructuring) and add to PartitionStatus but that's bigger efforts. So let's start with client approach

sehz avatar Sep 05 '24 15:09 sehz

@diogopontual this PR will send you all over the code base. Once you are done, you'll have a pretty good grip on how fluvio works 😉

ajhunyady avatar Sep 05 '24 16:09 ajhunyady

Sounds good! That sounds good! I hope to understand everything and create this PR quickly!

TY

diogopontual avatar Sep 05 '24 17:09 diogopontual

Hey @ajhunyady, I'm sorry for the long delay. I had some issues with my previous job, and I was fixing them.

Well, I am back. Looking at the current description, more data fields are being printed:

Image

Should I remove some of them to make it similar to this issue description?

Thank you.

diogopontual avatar Oct 04 '24 12:10 diogopontual

Im taking advantage of Type field as of the new issues API here!

Image

LeoBorai avatar Oct 04 '24 16:10 LeoBorai

Hey @ajhunyady, I'm sorry for the long delay. I had some issues with my previous job, and I was fixing them.

Well, I am back. Looking at the current description, more data fields are being printed:

Image

Should I remove some of them to make it similar to this issue description?

Thank you.

Hi @diogopontual welcome back :)

It looks like I missed a few fields. I've edited the issue description to include the other parameters. I left out (ignore rack assignment). Let me know if I missed anything relevant.

ajhunyady avatar Oct 04 '24 19:10 ajhunyady