Skip to content

Commit

Permalink
Feature: add summary for gas used and gas limit per block (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky authored Jul 15, 2024
1 parent 59ab202 commit 697a343
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/api/docs/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cmd/api/markdown/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Returns string value by passed table and function.
* `supply_chnge` -- min max sum avg
* `inflation_rate` -- min max avg
* `fee` -- min max sum avg
* `gas_used` -- min max sum avg
* `gas_limit` -- min max sum avg

#### Tx
* `height` -- min max
Expand Down
4 changes: 2 additions & 2 deletions internal/storage/block_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type BlockStats struct {
BlobsSize int64 `bun:"blobs_size" comment:"Summary blocks size from pay for blob" stats:"func:min max sum avg"`
BlobsCount int `bun:"blobs_count" comment:"Summary blobs count in the block" stats:"func:min max sum avg"`
BlockTime uint64 `bun:"block_time" comment:"Time in milliseconds between current and previous block" stats:"func:min max sum avg"`
GasLimit int64 `bun:"gas_limit" comment:"Total gas limit in the block"`
GasUsed int64 `bun:"gas_used" comment:"Total gas used in the block"`
GasLimit int64 `bun:"gas_limit" comment:"Total gas limit in the block" stats:"func:min max sum avg"`
GasUsed int64 `bun:"gas_used" comment:"Total gas used in the block" stats:"func:min max sum avg"`
SupplyChange decimal.Decimal `bun:",type:numeric" comment:"Change of total supply in the block" stats:"func:min max sum avg"`
InflationRate decimal.Decimal `bun:",type:numeric" comment:"Inflation rate" stats:"func:min max avg"`
Fee decimal.Decimal `bun:"fee,type:numeric" comment:"Summary block fee" stats:"func:min max sum avg"`
Expand Down

0 comments on commit 697a343

Please sign in to comment.