Skip to content

Commit

Permalink
Fixed bug where stopwatch wouldn't reset when an error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhks committed Apr 8, 2019
1 parent d58e025 commit 2534fac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.kairosdb</groupId>
<artifactId>kairos-remote</artifactId>
<version>1.1</version>
<version>1.1.1</version>
<packaging>jar</packaging>

<name>kairos-remote</name>
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/org/kairosdb/plugin/remote/RemoteListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public class RemoteListener
private String m_dataFileName;
private volatile boolean m_firstDataPoint = true;
private int m_dataPointCounter;
private Stopwatch m_sendTimer = Stopwatch.createUnstarted();

private volatile Multimap<DataPointKey, DataPoint> m_dataPointMultimap;
private final Object m_mapLock = new Object(); //Lock for the above map
Expand Down Expand Up @@ -447,14 +446,13 @@ void sendData() throws IOException
{

long now = System.currentTimeMillis();
m_sendTimer.start();
Stopwatch sendTimer = Stopwatch.createStarted();
long timeToSend = 0L;

rollAndZipFile(now, false);

sendAllZipfiles();

long timeToSend = m_sendTimer.elapsed(TimeUnit.MILLISECONDS);
m_sendTimer.reset();
timeToSend = sendTimer.elapsed(TimeUnit.MILLISECONDS);

try
{
Expand Down

0 comments on commit 2534fac

Please sign in to comment.