github.com/ethereum/go-ethereum@v1.16.1/eth/protocols/snap/metrics.go (about) 1 // Copyright 2023 The go-ethereum Authors 2 // This file is part of the go-ethereum library. 3 // 4 // The go-ethereum library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The go-ethereum library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 16 17 package snap 18 19 import ( 20 "github.com/ethereum/go-ethereum/metrics" 21 ) 22 23 var ( 24 ingressRegistrationErrorName = "eth/protocols/snap/ingress/registration/error" 25 egressRegistrationErrorName = "eth/protocols/snap/egress/registration/error" 26 27 IngressRegistrationErrorMeter = metrics.NewRegisteredMeter(ingressRegistrationErrorName, nil) 28 EgressRegistrationErrorMeter = metrics.NewRegisteredMeter(egressRegistrationErrorName, nil) 29 30 // accountInnerDeleteGauge is the metric to track how many dangling trie nodes 31 // covered by extension node in account trie are deleted during the sync. 32 accountInnerDeleteGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/delete/account/inner", nil) 33 34 // storageInnerDeleteGauge is the metric to track how many dangling trie nodes 35 // covered by extension node in storage trie are deleted during the sync. 36 storageInnerDeleteGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/delete/storage/inner", nil) 37 38 // accountOuterDeleteGauge is the metric to track how many dangling trie nodes 39 // above the committed nodes in account trie are deleted during the sync. 40 accountOuterDeleteGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/delete/account/outer", nil) 41 42 // storageOuterDeleteGauge is the metric to track how many dangling trie nodes 43 // above the committed nodes in storage trie are deleted during the sync. 44 storageOuterDeleteGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/delete/storage/outer", nil) 45 46 // lookupGauge is the metric to track how many trie node lookups are 47 // performed to determine if node needs to be deleted. 48 accountInnerLookupGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/account/lookup/inner", nil) 49 accountOuterLookupGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/account/lookup/outer", nil) 50 storageInnerLookupGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/storage/lookup/inner", nil) 51 storageOuterLookupGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/storage/lookup/outer", nil) 52 53 // smallStorageGauge is the metric to track how many storages are small enough 54 // to retrieved in one or two request. 55 smallStorageGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/storage/small", nil) 56 57 // largeStorageGauge is the metric to track how many storages are large enough 58 // to retrieved concurrently. 59 largeStorageGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/storage/large", nil) 60 61 // skipStorageHealingGauge is the metric to track how many storages are retrieved 62 // in multiple requests but healing is not necessary. 63 skipStorageHealingGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/storage/noheal", nil) 64 65 // largeStorageDiscardGauge is the metric to track how many chunked storages are 66 // discarded during the snap sync. 67 largeStorageDiscardGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/storage/chunk/discard", nil) 68 largeStorageResumedGauge = metrics.NewRegisteredGauge("eth/protocols/snap/sync/storage/chunk/resume", nil) 69 )