Skip to content
Snippets Groups Projects
Commit f8e83607 authored by gordon chung's avatar gordon chung Committed by mergify[bot]
Browse files

use fromiter to build array

incoming data isn't that large but if we don't need to build a list
why build it.
parent cb8a0e46
No related branches found
No related tags found
No related merge requests found
......@@ -160,8 +160,8 @@ class IncomingDriver(object):
raise
def _encode_measures(self, measures):
return numpy.array(list(measures),
dtype=TIMESERIES_ARRAY_DTYPE).tobytes()
return numpy.fromiter(measures,
dtype=TIMESERIES_ARRAY_DTYPE).tobytes()
def group_metrics_by_sack(self, metrics):
"""Iterate on a list of metrics, grouping them by sack.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment