hicetnunc icon indicating copy to clipboard operation
hicetnunc copied to clipboard

API Lag Indicator

Open kylegrover opened this issue 3 years ago • 6 comments

We have a new api lag endpoint available at https://api.hicdex.com/status.json with a score of 1 being normal and greater than or equal to 5 indicating a warning.

.lag is $(($LAST_BLOCK_LEVEL - $LAST_INDEXED_BLOCK_LEVEL)), status.json gets written every other minute

It would save a lot of headaches if we built some frontend indicator that checks this endpoint on page load and shows an indicator somewhere if it's above a certain level.

kylegrover avatar Jun 20 '21 20:06 kylegrover

I can take a crack at this - would you prefer a top banner approach if lag > 5 or a small animated status icon next to the hic logo for example? image

wallopthecat avatar Jun 21 '21 03:06 wallopthecat

Both ideas are good. Maybe a banner/popup that shows up once and goes away after a click and then an indicator dot that's always there if lag is above x

kylegrover avatar Jun 21 '21 23:06 kylegrover

queued_metadata field now available as well to indicate objkt metadata lag:

lag is #blocks behind blockchain level, queued_metadata is #objkts indexed but waiting for metadata to be retrievable

kylegrover avatar Jun 22 '21 20:06 kylegrover

Is there a need to make it so prominent for all users in the header? The important use cases are when buying, swapping, burning, etc on the objkt details page (as these are most affected by indexing lag), so perhaps it could be associated with these activities.

If you use eg red/green colour to indicate lag, please be aware of colour blindness (red/green is the most common). A tooltip that adds some diagnostics eg index block: 12345662. delay: 4 could be useful.

As a comparator, Uniswap has a lag indicator in the bottom-right hand corner of the page: https://app.uniswap.org/#/swap

skenaja avatar Jun 22 '21 21:06 skenaja

I think we do need to make it visible to everyone, or nearly everyone. Seems like the main time people notice a problem is after they've minted or swapped and it doesn't show up right in the UI. If we only showed it before contract actions we'd miss the first few people and they wouldn't get any indication while checking the UI unless they tried a new transaction. There are also bugs that are noticeable without making a transaction, like the home feed being 'stuck' or metadata not showing. Maybe we don't show the banner, just a circle/indicator, and show info before transactions, like "Hicetnunc UI is currently experiencing lag, some transactions may not work. Check your wallet to confirm transactions and token status"

Good point on red/green, I think using red as an indicator is okay but we shouldn't then show the same shape/indicator in green when it's good. We should just not show an indicator in the main UI if there's no lag.

We could also expose this stuff with more info or explanation on a /status page.

kylegrover avatar Jun 22 '21 21:06 kylegrover

A status page with the detailed block numbers + lag amt would be good. I had been thinking that use of colour might "pop" a bit too much on the page on a mostly monochrome site (where the art is usually the only colourful thing on the page), could be seen to be distracting to some. How about a simplistic network: ✓ or network: ⧖ in a smaller font under the account/sync link in the header?

✓ U+02713 CHECK MARK ⧖ U+029D6 WHITE HOURGLASS ⧗ U+029D7 BLACK HOURGLASS

skenaja avatar Jun 22 '21 22:06 skenaja