-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INDY-1475: Implement metrics gathering #837
Conversation
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
(ci) test this please |
@@ -110,6 +112,7 @@ def flushOutBoxes(self) -> None: | |||
for batch in batches: | |||
logger.trace("{} sending payload to {}: {}".format( | |||
self, dest, batch)) | |||
self.metrics.add_event(MetricType.TRANSPORT_BATCH_SIZE, len(batch)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be interesting to know not only the size of a batch in bytes, but in number of messages in the batch
pass | ||
|
||
|
||
class KvStoreMetricsCollector(MetricsCollector): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a description of what is the structure of key and values in the DB.
@@ -21,14 +22,15 @@ class Batched(MessageProcessor): | |||
Assumes a Stack (ZStack or RStack) is mixed | |||
""" | |||
|
|||
def __init__(self, config=None): | |||
def __init__(self, config=None, metrics=NullMetricsCollector()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use decorators/annotations for injecting a metric field into classes?
seed=seed, sighex=sighex, config=config) | ||
seed=seed, sighex=sighex, config=config, | ||
metrics=metrics, | ||
mt_incoming_size=MetricType.INCOMING_NODE_MESSAGE_SIZE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need explicitly pass mt_incoming_size
and mt_outgoing_size
params here?
from storage.kv_store import KeyValueStorage | ||
|
||
|
||
class MetricType(IntEnum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to know how many node-to-node messages we have for 1 3PC Batch and 1 request
CLIENT_STACK_MESSAGES_PROCESSED = 1 | ||
LOOPER_RUN_TIME_SPENT = 2 | ||
THREE_PC_BATCH_SIZE = 3 | ||
TRANSPORT_BATCH_SIZE = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the size in KB, right? We need also size in number of messages
logger.trace('{} transmitting message {} to {}'.format(self, msg, uid)) | ||
self.metrics.add_event(self.mt_outgoing_size, len(msg)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also specify the message type?
create_listener_monitor=config.TRACK_CONNECTED_CLIENTS_NUM_ENABLED) | ||
create_listener_monitor=config.TRACK_CONNECTED_CLIENTS_NUM_ENABLED, | ||
metrics=metrics, | ||
mt_incoming_size=MetricType.INCOMING_CLIENT_MESSAGE_SIZE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use onlyListener
to distinguish between client and node stacks?
Signed-off-by: Sergey Khoroshavin sergey.khoroshavin@dsr-corporation.com