Skip to content
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

Merged
merged 7 commits into from
Jul 26, 2018

Conversation

skhoroshavin
Copy link
Member

Signed-off-by: Sergey Khoroshavin sergey.khoroshavin@dsr-corporation.com

Sergey Khoroshavin and others added 7 commits July 25, 2018 13:04
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>
@skhoroshavin
Copy link
Member Author

(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))
Copy link
Contributor

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):
Copy link
Contributor

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()):
Copy link
Contributor

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,
Copy link
Contributor

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):
Copy link
Contributor

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
Copy link
Contributor

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))
Copy link
Contributor

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,
Copy link
Contributor

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?

@ashcherbakov ashcherbakov merged commit 72ddbd0 into hyperledger:master Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants