Skip to content

Commit 2534fac

Browse files
committed
Fixed bug where stopwatch wouldn't reset when an error occurs
1 parent d58e025 commit 2534fac

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>org.kairosdb</groupId>
66
<artifactId>kairos-remote</artifactId>
7-
<version>1.1</version>
7+
<version>1.1.1</version>
88
<packaging>jar</packaging>
99

1010
<name>kairos-remote</name>

src/main/java/org/kairosdb/plugin/remote/RemoteListener.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ public class RemoteListener
7676
private String m_dataFileName;
7777
private volatile boolean m_firstDataPoint = true;
7878
private int m_dataPointCounter;
79-
private Stopwatch m_sendTimer = Stopwatch.createUnstarted();
8079

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

449448
long now = System.currentTimeMillis();
450-
m_sendTimer.start();
449+
Stopwatch sendTimer = Stopwatch.createStarted();
450+
long timeToSend = 0L;
451451

452452
rollAndZipFile(now, false);
453-
454453
sendAllZipfiles();
455454

456-
long timeToSend = m_sendTimer.elapsed(TimeUnit.MILLISECONDS);
457-
m_sendTimer.reset();
455+
timeToSend = sendTimer.elapsed(TimeUnit.MILLISECONDS);
458456

459457
try
460458
{

0 commit comments

Comments
 (0)