aeternity / ae_mdw

Aeternity Middleware in Elixir
26 stars 11 forks source link

Include minutes per block statistics #1942

Closed janmichek closed 1 week ago

janmichek commented 2 months ago

please include value

blocks per minute to v3/stats It should be around 3 minutes per block

The formula is fairly simple. This is how I count it on FE.

image

I believe you are already using this approximate value in your computations, so it should be easy to expose, right?

yaboiishere commented 2 months ago

Just to make sure firstKeyblockTime is the block at height 1, right?

janmichek commented 2 months ago

Not super sure with it. Keyblock 0 does not have time set.

yaboiishere commented 2 months ago

Right now I'm using the block at height 1, is something like this ok?

{
    "miners_count": 211,
    "fees_trend": 0,
    "max_transactions_per_second": 52.36,
    "max_transactions_per_second_block_hash": "kh_2ek9oteSQ6KTULak4RHiqSTLebuQjMNNEujmLRZsgirMginJgW",
    "last_24hs_transactions": 0,
    "transactions_trend": 0,
    "last_24hs_average_transaction_fees": 0,
    "minutes_per_block": "0h 2m 59s 656ms"
}
janmichek commented 2 months ago

I will think about the output format and let you know next week

janmichek commented 2 months ago

Right now I'm using the block at height 1, is something like this ok?

{
    "miners_count": 211,
    "fees_trend": 0,
    "max_transactions_per_second": 52.36,
    "max_transactions_per_second_block_hash": "kh_2ek9oteSQ6KTULak4RHiqSTLebuQjMNNEujmLRZsgirMginJgW",
    "last_24hs_transactions": 0,
    "transactions_trend": 0,
    "last_24hs_average_transaction_fees": 0,
    "minutes_per_block": "0h 2m 59s 656ms"
}

Please format the response in milliseconds.

I am not sure about it, why the block 0 does not have any time entry?

yaboiishere commented 2 months ago

Forgot to give an update, I'm not sure why it's 0, but it's that way on the node aswell, so it should be ok to use height 1. The feature should be in the next release

yaboiishere commented 1 month ago

This has been deployed -> https://mainnet.aeternity.io/mdw/v3/stats

janmichek commented 1 month ago

Ok, cool! I would just expect the value to be named accordingly - milliseconds or mircro time to be consistent with mdw naming. Can you rename it, please? I haven't used it so far. What name do you suggest?

yaboiishere commented 1 month ago

Yeah, I seem to have missed it. How does ms_per_block sound?

janmichek commented 1 month ago

I dont't have specific preference. You might use your naming convention. Afaik you use 'micro' prefix. Up to you

janmichek commented 1 week ago

🥇