You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by 이승진 <sw...@navercorp.com> on 2014/06/25 10:10:58 UTC
How do you measure TPS of topology?
Dear all,
Is there a good practice of measuring TPS of topology?
I have no idea where to start from since there's only latency information in storm UI
would be great if you can share your experience
Sincerly,
Re: How do you measure TPS of topology?
Posted by Romain Leroux <le...@gmail.com>.
Probably not a good practice but at least gives you an idea :
public class LogThroughput extends BaseFunction{
private static final Logger LOG =
LoggerFactory.getLogger(LogThroughput.class);
private AtomicInteger tuplesCounter;
private Thread tWatcher;
private String message;
private class WatcherThread implements Runnable {
@Override
public void run() {
while(!Thread.interrupted()) {
try {
Thread.sleep(1000);
LOG.info("<"+message+"> Throughput:
"+tuplesCounter.getAndSet(0)+" tuples/sec at "+new Date().toString());
} catch (InterruptedException e) {
}
}
}
}
public LogThroughput(String message){
this.message = message;
}
public LogThroughput(){
this.message = "";
}
@Override
public void prepare(Map conf, TridentOperationContext context) {
tuplesCounter = new AtomicInteger(0);
tWatcher = new Thread(new WatcherThread(), "watcher1337");
tWatcher.start();
}
@Override
public void execute(TridentTuple tuple, TridentCollector collector) {
tuplesCounter.incrementAndGet();
collector.emit(tuple);
}
}
2014-06-25 17:10 GMT+09:00 이승진 <sw...@navercorp.com>:
> Dear all,
>
>
> Is there a good practice of measuring TPS of topology?
>
> I have no idea where to start from since there's only latency information
> in storm UI
>
> would be great if you can share your experience
>
>
> Sincerly,
>