Skip to content

Commit 9e60f4e

Browse files
committed
Remove scales dependency with self-contained metrics implementation
The scales library had its last release in 2015 and was only tested on Python 2.7/3.3. This change replaces it with a self-contained metrics implementation that provides the same functionality: - IntStat: Thread-safe integer counter - PmfStat: Percentile/distribution statistics with reservoir sampling - Stat: Gauge statistics with callable evaluation - StatsCollection: Named collections of statistics - Global registry for metrics access via getStats() The new implementation maintains API compatibility with the existing metrics interface used by the driver. Fixes #665
1 parent 21f0ff4 commit 9e60f4e

8 files changed

Lines changed: 639 additions & 68 deletions

File tree

benchmarks/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from optparse import OptionParser
2222
import uuid
2323

24-
from greplin import scales
24+
from cassandra.metrics import getStats
2525

2626
dirname = os.path.dirname(os.path.abspath(__file__))
2727
sys.path.append(dirname)
@@ -192,7 +192,7 @@ def benchmark(thread_class):
192192
log.info("Total time: %0.2fs" % total)
193193
log.info("Average throughput: %0.2f/sec" % (options.num_ops / total))
194194
if options.enable_metrics:
195-
stats = scales.getStats()['cassandra']
195+
stats = getStats()['cassandra']
196196
log.info("Connection errors: %d", stats['connection_errors'])
197197
log.info("Write timeouts: %d", stats['write_timeouts'])
198198
log.info("Read timeouts: %d", stats['read_timeouts'])

0 commit comments

Comments
 (0)