abaQuery - flow tps
    Updated 2022-07-18
    -- flow tps
    with blocks_tps as (
    select b.ID,
    b.TX_COUNT,
    iff(
    TIMESTAMPDIFF(second,b.BLOCK_TIMESTAMP,b2.BLOCK_TIMESTAMP) != 0,
    TIMESTAMPDIFF(second,b.BLOCK_TIMESTAMP,b2.BLOCK_TIMESTAMP), 1) as block_time ,
    (b.TX_COUNT/block_time) as tps
    from flow.core.fact_blocks as b
    join flow.core.fact_blocks as b2
    on b.ID = b2.PARENT_ID
    )
    select avg(tps) tps
    from blocks_tps


    Run a query to Download Data