Cost-Aware Streaming Data Analysis: Distributed vs Single-Thread