| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | package geth |
| 4 | |
| 5 | import "github.com/netdata/netdata/go/plugins/plugin/framework/collectorapi" |
| 6 | |
| 7 | type ( |
| 8 | Charts = collectorapi.Charts |
| 9 | Chart = collectorapi.Chart |
| 10 | Dims = collectorapi.Dims |
| 11 | Dim = collectorapi.Dim |
| 12 | ) |
| 13 | |
| 14 | var charts = Charts{ |
| 15 | chartAncientChainData.Copy(), |
| 16 | chartChaindataDisk.Copy(), |
| 17 | chartAncientChainDataRate.Copy(), |
| 18 | chartChaindataDiskRate.Copy(), |
| 19 | chartChainDataSize.Copy(), |
| 20 | chartChainHead.Copy(), |
| 21 | chartP2PNetwork.Copy(), |
| 22 | chartNumberOfPeers.Copy(), |
| 23 | chartp2pDialsServes.Copy(), |
| 24 | chartReorgs.Copy(), |
| 25 | chartReorgsBlocks.Copy(), |
| 26 | chartGoRoutines.Copy(), |
| 27 | chartTxPoolCurrent.Copy(), |
| 28 | chartTxPoolQueued.Copy(), |
| 29 | chartTxPoolPending.Copy(), |
| 30 | chartRpcInformation.Copy(), |
| 31 | } |
| 32 | |
| 33 | var ( |
| 34 | chartAncientChainDataRate = Chart{ |
| 35 | ID: "chaindata_ancient_rate", |
| 36 | Title: "Ancient Chaindata rate", |
| 37 | Units: "bytes/s", |
| 38 | Fam: "chaindata", |
| 39 | Ctx: "geth.eth_db_chaindata_ancient_io_rate", |
| 40 | Dims: Dims{ |
| 41 | {ID: ethDbChainDataAncientRead, Name: "reads", Algo: "incremental"}, |
| 42 | {ID: ethDbChainDataAncientWrite, Name: "writes", Mul: -1, Algo: "incremental"}, |
| 43 | }, |
| 44 | } |
| 45 | |
| 46 | chartAncientChainData = Chart{ |
| 47 | ID: "chaindata_ancient", |
| 48 | Title: "Session ancient Chaindata", |
| 49 | Units: "bytes", |
| 50 | Fam: "chaindata", |
| 51 | Ctx: "geth.eth_db_chaindata_ancient_io", |
| 52 | Dims: Dims{ |
| 53 | {ID: ethDbChainDataAncientRead, Name: "reads"}, |
| 54 | {ID: ethDbChainDataAncientWrite, Name: "writes", Mul: -1}, |
| 55 | }, |
| 56 | } |
| 57 | chartChaindataDisk = Chart{ |
| 58 | ID: "chaindata_disk", |
| 59 | Title: "Session chaindata on disk", |
| 60 | Units: "bytes", |
| 61 | Fam: "chaindata", |
| 62 | Ctx: "geth.eth_db_chaindata_disk_io", |
| 63 | Dims: Dims{ |
| 64 | {ID: ethDbChaindataDiskRead, Name: "reads"}, |
| 65 | {ID: ethDbChainDataDiskWrite, Name: "writes", Mul: -1}, |
| 66 | }, |
| 67 | } |
| 68 | chartGoRoutines = Chart{ |
| 69 | ID: "goroutines", |
| 70 | Title: "Number of goroutines", |
| 71 | Units: "goroutines", |
| 72 | Fam: "goroutines", |
| 73 | Ctx: "geth.goroutines", |
| 74 | Dims: Dims{ |
| 75 | {ID: goRoutines, Name: "goroutines"}, |
| 76 | }, |
| 77 | } |
| 78 | chartChaindataDiskRate = Chart{ |
| 79 | ID: "chaindata_disk_date", |
| 80 | Title: "On disk Chaindata rate", |
| 81 | Units: "bytes/s", |
| 82 | Fam: "chaindata", |
| 83 | Ctx: "geth.eth_db_chaindata_disk_io_rate", |
| 84 | Dims: Dims{ |
| 85 | {ID: ethDbChaindataDiskRead, Name: "reads", Algo: "incremental"}, |
| 86 | {ID: ethDbChainDataDiskWrite, Name: "writes", Mul: -1, Algo: "incremental"}, |
| 87 | }, |
| 88 | } |
| 89 | chartChainDataSize = Chart{ |
| 90 | ID: "chaindata_db_size", |
| 91 | Title: "Chaindata Size", |
| 92 | Units: "bytes", |
| 93 | Fam: "chaindata", |
| 94 | Ctx: "geth.chaindata_db_size", |
| 95 | Dims: Dims{ |
| 96 | {ID: ethDbChainDataDiskSize, Name: "levelDB"}, |
| 97 | {ID: ethDbChainDataAncientSize, Name: "ancientDB"}, |
| 98 | }, |
| 99 | } |
| 100 | chartChainHead = Chart{ |
| 101 | ID: "chainhead_overall", |
| 102 | Title: "Chainhead", |
| 103 | Units: "block", |
| 104 | Fam: "chainhead", |
| 105 | Ctx: "geth.chainhead", |
| 106 | Dims: Dims{ |
| 107 | {ID: chainHeadBlock, Name: "block"}, |
| 108 | {ID: chainHeadReceipt, Name: "receipt"}, |
| 109 | {ID: chainHeadHeader, Name: "header"}, |
| 110 | }, |
| 111 | } |
| 112 | chartTxPoolPending = Chart{ |
| 113 | ID: "txpoolpending", |
| 114 | Title: "Pending Transaction Pool", |
| 115 | Units: "transactions", |
| 116 | Fam: "tx_pool", |
| 117 | Ctx: "geth.tx_pool_pending", |
| 118 | Dims: Dims{ |
| 119 | {ID: txPoolInvalid, Name: "invalid"}, |
| 120 | {ID: txPoolPending, Name: "pending"}, |
| 121 | {ID: txPoolLocal, Name: "local"}, |
| 122 | {ID: txPoolPendingDiscard, Name: " discard"}, |
| 123 | {ID: txPoolNofunds, Name: "no funds"}, |
| 124 | {ID: txPoolPendingRatelimit, Name: "ratelimit"}, |
| 125 | {ID: txPoolPendingReplace, Name: "replace"}, |
| 126 | }, |
| 127 | } |
| 128 | chartTxPoolCurrent = Chart{ |
| 129 | ID: "txpoolcurrent", |
| 130 | Title: "Transaction Pool", |
| 131 | Units: "transactions", |
| 132 | Fam: "tx_pool", |
| 133 | Ctx: "geth.tx_pool_current", |
| 134 | Dims: Dims{ |
| 135 | {ID: txPoolInvalid, Name: "invalid"}, |
| 136 | {ID: txPoolPending, Name: "pending"}, |
| 137 | {ID: txPoolLocal, Name: "local"}, |
| 138 | {ID: txPoolNofunds, Name: "pool"}, |
| 139 | }, |
| 140 | } |
| 141 | chartTxPoolQueued = Chart{ |
| 142 | ID: "txpoolqueued", |
| 143 | Title: "Queued Transaction Pool", |
| 144 | Units: "transactions", |
| 145 | Fam: "tx_pool", |
| 146 | Ctx: "geth.tx_pool_queued", |
| 147 | Dims: Dims{ |
| 148 | {ID: txPoolQueuedDiscard, Name: "discard"}, |
| 149 | {ID: txPoolQueuedEviction, Name: "eviction"}, |
| 150 | {ID: txPoolQueuedNofunds, Name: "no_funds"}, |
| 151 | {ID: txPoolQueuedRatelimit, Name: "ratelimit"}, |
| 152 | }, |
| 153 | } |
| 154 | chartP2PNetwork = Chart{ |
| 155 | ID: "p2p_network", |
| 156 | Title: "P2P bandwidth", |
| 157 | Units: "bytes/s", |
| 158 | Fam: "p2p_bandwidth", |
| 159 | Ctx: "geth.p2p_bandwidth", |
| 160 | Dims: Dims{ |
| 161 | {ID: p2pIngress, Name: "ingress", Algo: "incremental"}, |
| 162 | {ID: p2pEgress, Name: "egress", Mul: -1, Algo: "incremental"}, |
| 163 | }, |
| 164 | } |
| 165 | chartReorgs = Chart{ |
| 166 | ID: "reorgs_executed", |
| 167 | Title: "Executed Reorgs", |
| 168 | Units: "reorgs", |
| 169 | Fam: "reorgs", |
| 170 | Ctx: "geth.reorgs", |
| 171 | Dims: Dims{ |
| 172 | {ID: reorgsExecuted, Name: "executed"}, |
| 173 | }, |
| 174 | } |
| 175 | chartReorgsBlocks = Chart{ |
| 176 | ID: "reorgs_blocks", |
| 177 | Title: "Blocks Added/Removed from Reorg", |
| 178 | Units: "blocks", |
| 179 | Fam: "reorgs", |
| 180 | Ctx: "geth.reorgs_blocks", |
| 181 | Dims: Dims{ |
| 182 | {ID: reorgsAdd, Name: "added"}, |
| 183 | {ID: reorgsDropped, Name: "dropped"}, |
| 184 | }, |
| 185 | } |
| 186 | |
| 187 | chartNumberOfPeers = Chart{ |
| 188 | ID: "p2p_peers_number", |
| 189 | Title: "Number of Peers", |
| 190 | Units: "peers", |
| 191 | Fam: "p2p_peers", |
| 192 | Ctx: "geth.p2p_peers", |
| 193 | Dims: Dims{ |
| 194 | {ID: p2pPeers, Name: "peers"}, |
| 195 | }, |
| 196 | } |
| 197 | |
| 198 | chartp2pDialsServes = Chart{ |
| 199 | ID: "p2p_dials_serves", |
| 200 | Title: "P2P Serves and Dials", |
| 201 | Units: "calls/s", |
| 202 | Fam: "p2p_peers", |
| 203 | Ctx: "geth.p2p_peers_calls", |
| 204 | Dims: Dims{ |
| 205 | {ID: p2pDials, Name: "dials", Algo: "incremental"}, |
| 206 | {ID: p2pServes, Name: "serves", Algo: "incremental"}, |
| 207 | }, |
| 208 | } |
| 209 | chartRpcInformation = Chart{ |
| 210 | ID: "rpc_calls", |
| 211 | Title: "rpc calls", |
| 212 | Units: "calls/s", |
| 213 | Fam: "rpc", |
| 214 | Ctx: "geth.rpc_calls", |
| 215 | Dims: Dims{ |
| 216 | {ID: rpcFailure, Name: "failed", Algo: "incremental"}, |
| 217 | {ID: rpcSuccess, Name: "successful", Algo: "incremental"}, |
| 218 | }, |
| 219 | } |
| 220 | ) |