diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-19 16:23:44 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-13 18:11:44 +0800 |
commit | 560d599bd4e8febcf9a1ab11cce9dfe9b4c5bc52 (patch) | |
tree | cd2c6493075f2fa6374db35d9c5fb22837278b50 | |
parent | 52abd7878fc59776550c73b0e1c6746448c83c17 (diff) | |
download | go-tangerine-560d599bd4e8febcf9a1ab11cce9dfe9b4c5bc52.tar.gz go-tangerine-560d599bd4e8febcf9a1ab11cce9dfe9b4c5bc52.tar.zst go-tangerine-560d599bd4e8febcf9a1ab11cce9dfe9b4c5bc52.zip |
dex: add block confirme latency (#275)
-rw-r--r-- | dex/app.go | 2 | ||||
-rw-r--r-- | dex/metrics.go | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/dex/app.go b/dex/app.go index 3f580f12e..9a72d7795 100644 --- a/dex/app.go +++ b/dex/app.go @@ -478,6 +478,8 @@ func (d *DexconApp) BlockDelivered( // BlockConfirmed is called when a block is confirmed. func (d *DexconApp) BlockConfirmed(block coreTypes.Block) { + propBlockConfirmLatency.Update(time.Since(block.Timestamp).Nanoseconds() / 1000) + d.appMu.Lock() defer d.appMu.Unlock() diff --git a/dex/metrics.go b/dex/metrics.go index 4ca16ece5..1f691bc15 100644 --- a/dex/metrics.go +++ b/dex/metrics.go @@ -22,6 +22,7 @@ import ( ) var ( + propBlockConfirmLatency = metrics.NewRegisteredGauge("dex/prop/blockconfirm/latency", nil) propTxnInPacketsMeter = metrics.NewRegisteredMeter("dex/prop/txns/in/packets", nil) propTxnInTrafficMeter = metrics.NewRegisteredMeter("dex/prop/txns/in/traffic", nil) propTxnOutPacketsMeter = metrics.NewRegisteredMeter("dex/prop/txns/out/packets", nil) |