Commit da44b5fe authored by MartinFIT's avatar MartinFIT

Edited run scripts, disabled stats

parent 2e9d463f
#!/bin/sh
VM_IP=192.168.99.100
#VM_IP=192.168.99.100
VM_IP=`docker-machine ip default`
SPRING_DATA_CASSANDRA_CONTACT_POINTS=$VM_IP
HADOOP_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' hadoop`
......
#!/bin/sh
VM_IP=192.168.99.100
#VM_IP=192.168.99.100
VM_IP=`docker-machine ip default`
HADOOP_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' hadoop`
HDFS_PORT=9000
......
......@@ -35,8 +35,8 @@ public class StorePcapProducerDemo extends BaseProducerDemo {
return;
}
// TODO: Will be removed
initStatsForDirectory(directory);
// Uncomment this line to enable time-duration statistics
//initStatsForDirectory(directory);
Arrays.stream(directory.listFiles())
.filter(this::isPcapOrCapFile)
......@@ -58,8 +58,8 @@ public class StorePcapProducerDemo extends BaseProducerDemo {
byte[] bytes = preparePayload(dataSourceStorage, filename, requestId.toString());
KafkaRequest request = buildKafkaRequest(dataSource, Command.STORE_PCAP, requestId);
// TODO: Will be removed
initStatsForRequest(filename, request.getId());
// Uncomment this line to enable time-duration statistics
//initStatsForRequest(filename, request.getId());
producer.produce(inputTopic, request, bytes,
result -> unlockMutexForFile(filename),
......
......@@ -2,13 +2,10 @@ package cz.vutbr.fit.producerdemo.service.handler;
import cz.vutbr.fit.communication.KafkaResponse;
import cz.vutbr.fit.communication.service.handler.ICommandHandler;
import cz.vutbr.fit.producerdemo.stats.CollectStats;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.Date;
@Component
public class AcknowledgementConsumerHandler implements ICommandHandler<KafkaResponse, byte[]> {
......@@ -16,9 +13,10 @@ public class AcknowledgementConsumerHandler implements ICommandHandler<KafkaResp
@Override
public void handleRequest(KafkaResponse response, byte[] bytes) {
CollectStats.getInstance().setEndTime(response.getId(), new Date());
LOGGER.debug(response.toString());
CollectStats.getInstance().finalStats();
// Uncomment these two lines to enable time-duration statistics
//CollectStats.getInstance().setEndTime(response.getId(), new Date());
//CollectStats.getInstance().finalStats();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment