add nim-metrics

This commit is contained in:
Ștefan Talpalaru 2019-07-10 01:58:18 +02:00
parent dc0b288085
commit 5ee668516a
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
6 changed files with 14 additions and 5 deletions

5
.gitmodules vendored
View File

@ -132,3 +132,8 @@
path = vendor/news path = vendor/news
url = https://github.com/tormund/news url = https://github.com/tormund/news
branch = master branch = master
[submodule "vendor/nim-metrics"]
path = vendor/nim-metrics
url = https://github.com/status-im/nim-metrics.git
ignore = dirty
branch = master

View File

@ -15,4 +15,5 @@
--threads:on --threads:on
--excessiveStackTrace:on --excessiveStackTrace:on
-d:metrics # enable metric collection

View File

@ -127,7 +127,9 @@ proc start(): NimbusObject =
# periodically log internal statistics # periodically log internal statistics
let statsInterval = 10.seconds let statsInterval = 10.seconds
proc printStats(udata: pointer) {.closure, gcsafe.} = proc printStats(udata: pointer) {.closure, gcsafe.} =
info "stats", nimbusStats {.gcsafe.}:
let peers = peerGauge.value.int64
info "stats", peers
addTimer(Moment.fromNow(statsInterval), printStats) addTimer(Moment.fromNow(statsInterval), printStats)
addTimer(Moment.fromNow(statsInterval), printStats) addTimer(Moment.fromNow(statsInterval), printStats)

View File

@ -596,14 +596,14 @@ proc setupCreate(computation: BaseComputation, memPos, len: int, value: Uint256,
some(computation.getFork)) some(computation.getFork))
template genCreate(callName: untyped, opCode: Op): untyped = template genCreate(callName: untyped, opCode: Op): untyped =
op callName, inline = false, value, startPosition, size: op callName, inline = false, val, startPosition, size:
## 0xf0, Create a new account with associated code. ## 0xf0, Create a new account with associated code.
let (memPos, len) = (startPosition.safeInt, size.safeInt) let (memPos, len) = (startPosition.safeInt, size.safeInt)
if not computation.canTransfer(memPos, len, value, opCode): if not computation.canTransfer(memPos, len, val, opCode):
push: 0 push: 0
return return
var childComp = setupCreate(computation, memPos, len, value, opCode) var childComp = setupCreate(computation, memPos, len, val, opCode)
if childComp.isNil: return if childComp.isNil: return
continuation(childComp): continuation(childComp):

2
vendor/nim-eth vendored

@ -1 +1 @@
Subproject commit 1797b7635124875fe0e212d7df5bd1836f22cbaa Subproject commit 93637fa0609129d8257adab022a3d7f1857a6516

1
vendor/nim-metrics vendored Submodule

@ -0,0 +1 @@
Subproject commit bf5c678fa070c3582093b2b5785abee367c9934a