ipni / storetheindex

A directory of CIDs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove the “lag” value from the providers information

gammazero opened this issue · comments

The "lag" value is misleading. It only has a non-zero value while the indexer is actively ingesting data for that provider, and was intended to show how many ads remained in the current sync. Unfortunately, this is confusing because:

  • a provider that is not caught up may have 0 lag because they do not have an active sync at the moment
  • there may only be a small number of ads remaining in a long duration sync, and none of the ads that were published since the start of the sync are represented in the lag.

A much more useful way to see how far an indexer is from being caught up is the distance command in ipni-cli. You can also use the --distance flag with the ipni provider command.

$ ipni provider -i dev.cid.contact --pid=12D3KooWMGrUbeADd5RQCzTq2ZWTyUqNVEJ6wkCpiSVDJ7RqQe54 --distance
Provider 12D3KooWMGrUbeADd5RQCzTq2ZWTyUqNVEJ6wkCpiSVDJ7RqQe54
    Addresses: [/ip4/114.80.86.243/tcp/24002]
    LastAdvertisement: baguqeeras2odduxvcu4mlh6zslkbta6j77lb3qccrvgohyflwuyn45upnyxq
    LastAdvertisementTime: 2023-05-26T23:31:46Z
    Lag: 0
    Publisher: 12D3KooWMGrUbeADd5RQCzTq2ZWTyUqNVEJ6wkCpiSVDJ7RqQe54
        Publisher Addrs: [/ip4/114.80.86.243/tcp/24002]
    IndexCount: 66680451
    Distance to head advertisement: 12

The “lag”, aka, “sync lag”, is useful. A non-zero lag tells us that there is a sync in progress for that provider, and how far that sync is from completing.

Closing issue in favor of keeping "lag".