Does interaction.sample apply to the firehose or your stream?


#1

I am a bit confused about how interaction.sample works. If I have interaction.sample < 5, will that sample 5% of tweets from the Twitter firehose before they are matched by a stream, or 5% of the tweets that have matched the stream?

The documentation page for interaction.sample states the following:

To sample, say, 5.25 percent of the incoming input objects...
So, I'm guessing it's sampling from the full firehose before applying the stream filter, but I want to be sure I understand correctly.

#2

It returns 5% of the interactions that have been matched by your filter. Using interaction.sample is great when testing your application, as it saves on licensing costs. Using it in this way means you will only receive 5% of the total interactions matched with your filter, so you will only be charged for these 5%, rather than the full 100%.


#3

Perfect, thanks!