-
Notifications
You must be signed in to change notification settings - Fork 377
[INDY-1599] Add strategies for latency measurement #892
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
Conversation
Signed-off-by: Andrew Nikitin <[email protected]>
Signed-off-by: Andrew Nikitin <[email protected]>
Signed-off-by: Andrew Nikitin <[email protected]>
Signed-off-by: Andrew Nikitin <[email protected]>
plenum/server/monitor.py
Outdated
return self.avg_latency | ||
|
||
|
||
class ClientsLatencyForAll(metaclass=ABCMeta): |
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 this class?
plenum/server/monitor.py
Outdated
pass | ||
|
||
|
||
class MedianHighLatencyForAllClients(MedianHighStrategy): |
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 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 |
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 not MedianHighStrategy directly?
plenum/server/node.py
Outdated
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)) |
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 use latency_avg_for_backup_cls
here
|
||
import pytest | ||
|
||
from plenum.server.monitor import EMALatencyMeasurementForAllClient, EMALatencyMeasurementForEachClient |
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.
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 |
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 also add a test where liM.get_avg_latency() - liB.get_avg_latency() >= tconf.OMEGA
Signed-off-by: Andrew Nikitin <[email protected]>
Signed-off-by: Andrew Nikitin <[email protected]>
Signed-off-by: Andrew Nikitin <[email protected]>
Signed-off-by: Andrew Nikitin <[email protected]>
Signed-off-by: Andrew Nikitin <[email protected]>
Signed-off-by: Andrew Nikitin <[email protected]>
No description provided.