Skeptic on where to implement functional coverage

In reply to sai_pra99:

You have to construct the coverage colle ctor as any other uvm_component and you are sampling only once. You have to sample this for any transaction you are extracting.
I have solved the first issue.
It’s up to you to fix the second one.
See the code here