-
Notifications
You must be signed in to change notification settings - Fork 979
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2161 from graydon/stop-looking-up-metrics-on-ever…
…y-packet overlay: cache metrics so we don't keep looking them up. Reviewed-by: MonsieurNicolas
- Loading branch information
Showing
13 changed files
with
259 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#include "overlay/OverlayMetrics.h" | ||
#include "main/Application.h" | ||
|
||
#include "medida/meter.h" | ||
#include "medida/metrics_registry.h" | ||
#include "medida/timer.h" | ||
|
||
namespace stellar | ||
{ | ||
|
||
OverlayMetrics::OverlayMetrics(Application& app) | ||
: mMessageRead( | ||
app.getMetrics().NewMeter({"overlay", "message", "read"}, "message")) | ||
, mMessageWrite( | ||
app.getMetrics().NewMeter({"overlay", "message", "write"}, "message")) | ||
, mByteRead(app.getMetrics().NewMeter({"overlay", "byte", "read"}, "byte")) | ||
, mByteWrite( | ||
app.getMetrics().NewMeter({"overlay", "byte", "write"}, "byte")) | ||
, mErrorRead( | ||
app.getMetrics().NewMeter({"overlay", "error", "read"}, "error")) | ||
, mErrorWrite( | ||
app.getMetrics().NewMeter({"overlay", "error", "write"}, "error")) | ||
, mTimeoutIdle( | ||
app.getMetrics().NewMeter({"overlay", "timeout", "idle"}, "timeout")) | ||
, mTimeoutStraggler(app.getMetrics().NewMeter( | ||
{"overlay", "timeout", "straggler"}, "timeout")) | ||
|
||
, mRecvErrorTimer(app.getMetrics().NewTimer({"overlay", "recv", "error"})) | ||
, mRecvHelloTimer(app.getMetrics().NewTimer({"overlay", "recv", "hello"})) | ||
, mRecvAuthTimer(app.getMetrics().NewTimer({"overlay", "recv", "auth"})) | ||
, mRecvDontHaveTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "dont-have"})) | ||
, mRecvGetPeersTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "get-peers"})) | ||
, mRecvPeersTimer(app.getMetrics().NewTimer({"overlay", "recv", "peers"})) | ||
, mRecvGetTxSetTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "get-txset"})) | ||
, mRecvTxSetTimer(app.getMetrics().NewTimer({"overlay", "recv", "txset"})) | ||
, mRecvTransactionTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "transaction"})) | ||
, mRecvGetSCPQuorumSetTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "get-scp-qset"})) | ||
, mRecvSCPQuorumSetTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "scp-qset"})) | ||
, mRecvSCPMessageTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "scp-message"})) | ||
, mRecvGetSCPStateTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "get-scp-state"})) | ||
|
||
, mRecvSCPPrepareTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "scp-prepare"})) | ||
, mRecvSCPConfirmTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "scp-confirm"})) | ||
, mRecvSCPNominateTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "scp-nominate"})) | ||
, mRecvSCPExternalizeTimer( | ||
app.getMetrics().NewTimer({"overlay", "recv", "scp-externalize"})) | ||
|
||
, mSendErrorMeter( | ||
app.getMetrics().NewMeter({"overlay", "send", "error"}, "message")) | ||
, mSendHelloMeter( | ||
app.getMetrics().NewMeter({"overlay", "send", "hello"}, "message")) | ||
, mSendAuthMeter( | ||
app.getMetrics().NewMeter({"overlay", "send", "auth"}, "message")) | ||
, mSendDontHaveMeter(app.getMetrics().NewMeter( | ||
{"overlay", "send", "dont-have"}, "message")) | ||
, mSendGetPeersMeter(app.getMetrics().NewMeter( | ||
{"overlay", "send", "get-peers"}, "message")) | ||
, mSendPeersMeter( | ||
app.getMetrics().NewMeter({"overlay", "send", "peers"}, "message")) | ||
, mSendGetTxSetMeter(app.getMetrics().NewMeter( | ||
{"overlay", "send", "get-txset"}, "message")) | ||
, mSendTransactionMeter(app.getMetrics().NewMeter( | ||
{"overlay", "send", "transaction"}, "message")) | ||
, mSendTxSetMeter( | ||
app.getMetrics().NewMeter({"overlay", "send", "txset"}, "message")) | ||
, mSendGetSCPQuorumSetMeter(app.getMetrics().NewMeter( | ||
{"overlay", "send", "get-scp-qset"}, "message")) | ||
, mSendSCPQuorumSetMeter( | ||
app.getMetrics().NewMeter({"overlay", "send", "scp-qset"}, "message")) | ||
, mSendSCPMessageSetMeter(app.getMetrics().NewMeter( | ||
{"overlay", "send", "scp-message"}, "message")) | ||
, mSendGetSCPStateMeter(app.getMetrics().NewMeter( | ||
{"overlay", "send", "get-scp-state"}, "message")) | ||
, mMessagesBroadcast(app.getMetrics().NewMeter( | ||
{"overlay", "message", "broadcast"}, "message")) | ||
, mPendingPeersSize( | ||
app.getMetrics().NewCounter({"overlay", "connection", "pending"})) | ||
, mAuthenticatedPeersSize(app.getMetrics().NewCounter( | ||
{"overlay", "connection", "authenticated"})) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#pragma once | ||
|
||
// Copyright 2019 Stellar Development Foundation and contributors. Licensed | ||
// under the Apache License, Version 2.0. See the COPYING file at the root | ||
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
// This structure just exists to cache frequently-accessed, overlay-wide | ||
// (non-peer-specific) metrics. Some of these metrics are subsequently | ||
// tabulated at a per-peer level for purposes of identifying and | ||
// disconnecting overloading peers, see LoadManager for details. | ||
|
||
namespace medida | ||
{ | ||
class Timer; | ||
class Meter; | ||
class Counter; | ||
} | ||
|
||
namespace stellar | ||
{ | ||
|
||
class Application; | ||
|
||
struct OverlayMetrics | ||
{ | ||
OverlayMetrics(Application& app); | ||
medida::Meter& mMessageRead; | ||
medida::Meter& mMessageWrite; | ||
medida::Meter& mByteRead; | ||
medida::Meter& mByteWrite; | ||
medida::Meter& mErrorRead; | ||
medida::Meter& mErrorWrite; | ||
medida::Meter& mTimeoutIdle; | ||
medida::Meter& mTimeoutStraggler; | ||
|
||
medida::Timer& mRecvErrorTimer; | ||
medida::Timer& mRecvHelloTimer; | ||
medida::Timer& mRecvAuthTimer; | ||
medida::Timer& mRecvDontHaveTimer; | ||
medida::Timer& mRecvGetPeersTimer; | ||
medida::Timer& mRecvPeersTimer; | ||
medida::Timer& mRecvGetTxSetTimer; | ||
medida::Timer& mRecvTxSetTimer; | ||
medida::Timer& mRecvTransactionTimer; | ||
medida::Timer& mRecvGetSCPQuorumSetTimer; | ||
medida::Timer& mRecvSCPQuorumSetTimer; | ||
medida::Timer& mRecvSCPMessageTimer; | ||
medida::Timer& mRecvGetSCPStateTimer; | ||
|
||
medida::Timer& mRecvSCPPrepareTimer; | ||
medida::Timer& mRecvSCPConfirmTimer; | ||
medida::Timer& mRecvSCPNominateTimer; | ||
medida::Timer& mRecvSCPExternalizeTimer; | ||
|
||
medida::Meter& mSendErrorMeter; | ||
medida::Meter& mSendHelloMeter; | ||
medida::Meter& mSendAuthMeter; | ||
medida::Meter& mSendDontHaveMeter; | ||
medida::Meter& mSendGetPeersMeter; | ||
medida::Meter& mSendPeersMeter; | ||
medida::Meter& mSendGetTxSetMeter; | ||
medida::Meter& mSendTransactionMeter; | ||
medida::Meter& mSendTxSetMeter; | ||
medida::Meter& mSendGetSCPQuorumSetMeter; | ||
medida::Meter& mSendSCPQuorumSetMeter; | ||
medida::Meter& mSendSCPMessageSetMeter; | ||
medida::Meter& mSendGetSCPStateMeter; | ||
|
||
medida::Meter& mMessagesBroadcast; | ||
medida::Counter& mPendingPeersSize; | ||
medida::Counter& mAuthenticatedPeersSize; | ||
}; | ||
} |
Oops, something went wrong.