why does the following function only runs once a sends only one set of data. I thought for each must mean for each value in the data set.
data_checkpoint_size = cclient.samples.list(meter_name ='checkpoint.size')
data_checkpoint_length = cclient.samples.list(meter_name ='checkpoint.length')
data_checkpoint_pause = cclient.samples.list(meter_name ='checkpoint.pause')
def counterVolume(data_checkpoint_size, data_checkpoint_length, data_checkpoint_pause):
for each in data_checkpoint_size:
d = each.counter_volume
for each in data_checkpoint_length:
e = each.counter_volume
for each in data_checkpoint_pause:
f = each.counter_volume
pubnub.publish(channel='channel', message= {'checkpoint_size': d, 'checkpoint_length': e, 'checkpoint_pause': f})
counterVolume(data_checkpoint_size, data_checkpoint_length, data_checkpoint_pause)
And I only get following as result instead of series of data. checkpoint_size, checkpoint_length and checkpoint_pause are three different meters, these are three different data streams
{
checkpoint_length: 75,
checkpoint_size: 5000,
checkpoint_pause: 50
}
pubnub.publishbeing only called once? It will get called once, because it's outside the loop.pubnub.publishfor each combination of values in the 3 lists , or like once for each 0th index in the list, second time for all 1st index, etc??