Skip to content

Commit a6feef7

Browse files
Added closing of REST Client in Sender
1 parent 7790678 commit a6feef7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/io/github/delirius325/jmeter/backendlistener/elasticsearch/ElasticSearchMetricSender.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ public ElasticSearchMetricSender(RestClient cli, String index) {
3434
public int getListSize() { return this.metricList.size(); }
3535

3636
/**
37-
* This method clears the ElasticSearch documents list
37+
* This method closes the REST client and clears the ElasticSearch documents list
3838
*/
39-
public void clearList() { this.metricList.clear(); }
39+
public void closeAndClear() throws IOException {
40+
this.client.close();
41+
this.metricList.clear();
42+
}
4043

4144
/**
4245
* This method adds a metric to the list (metricList).

0 commit comments

Comments
 (0)