In the examples provided on using the Monitoring Client:
https://github.com/oracle/oci-java-sdk/blob/master/bmc-examples/src/main/java/MonitoringMetricListExample.java
https://github.com/oracle/oci-java-sdk/blob/master/bmc-examples/src/main/java/MonitoringMetricSummarizeExample.java,
for the monitoringClient.summarizeMetricsData(request)
a new Monitoring Client is created and closed after a request. Is it necessary? Or can this client be reused for the new request, so for example there will be one client for the whole runtime of the application?
Should com.oracle.bmc.monitoring.MonitoringClient be closed every time after querying for metrics?
164 views Asked by aleksandra At
1
closing the client after every request is not necessary. You can re-use the same client for multiple requests, e.g. for the whole lifetime of the application.