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-1599] Add strategies for latency measurement #892

Merged
merged 10 commits into from
Sep 10, 2018

Conversation

lampkin-diet
Copy link

No description provided.

Andrew Nikitin added 4 commits August 22, 2018 10:37
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
return self.avg_latency


class ClientsLatencyForAll(metaclass=ABCMeta):
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 this class?

pass


class MedianHighLatencyForAllClients(MedianHighStrategy):
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 this class? Why don't use MedianHighStrategy strategy?

plenum/config.py Outdated
@@ -322,3 +324,7 @@
METRICS_KV_STORAGE = KeyValueStorageType.Rocksdb
METRICS_KV_DB_NAME = 'metrics_db'
METRICS_KV_CONFIG = rocksdb_default_config.copy()

AvgStrategyForAllClients = MedianHighLatencyForAllClients
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not MedianHighStrategy directly?

for instId in self.instances.backupIds:
lat = self.monitor.getLatency(instId)
if lat:
backup_latencies.append(lat)
if len(backup_latencies) > 0:
self.metrics.add_event(MetricsName.BACKUP_MONITOR_AVG_LATENCY, mean(backup_latencies))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use latency_avg_for_backup_cls here


import pytest

from plenum.server.monitor import EMALatencyMeasurementForAllClient, EMALatencyMeasurementForEachClient
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file name is test_EMALatencyMeasurementForAllClient.py while we are testing EMALatencyMeasurementForEachClient.
Can we test both BTW?

fill_durations(liB, clientB1)
fill_durations(liB, clientB2)

assert liM.get_avg_latency() - liB.get_avg_latency() < tconf.OMEGA
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 also add a test where liM.get_avg_latency() - liB.get_avg_latency() >= tconf.OMEGA

Andrew Nikitin added 6 commits August 29, 2018 17:06
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
@andkononykhin andkononykhin merged commit da0e63a into hyperledger:master Sep 10, 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

3 participants