Skip to content

Commit

Permalink
[IOTDB-4373] Fix statistic of disk in metric. (apache#7295)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpriCoder authored Sep 14, 2022
1 parent 06a599c commit 8f9e28b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void bindTo(AbstractMetricService metricService) {
"unseq");

// finally start to update the value of some metrics in async way
if (metricService.isEnable() && null != currentServiceFuture) {
if (metricService.isEnable() && null == currentServiceFuture) {
currentServiceFuture =
ScheduledExecutorUtil.safelyScheduleAtFixedRate(
service,
Expand All @@ -118,7 +118,7 @@ public void bindTo(AbstractMetricService metricService) {
public void unbindFrom(AbstractMetricService metricService) {
// first stop to update the value of some metrics in async way
if (currentServiceFuture != null) {
currentServiceFuture.cancel(false);
currentServiceFuture.cancel(true);
currentServiceFuture = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void bindTo(AbstractMetricService metricService) {
collectSystemMemInfo(metricService);

// finally start to update the value of some metrics in async way
if (metricService.isEnable() && null != currentServiceFuture) {
if (metricService.isEnable() && null == currentServiceFuture) {
currentServiceFuture =
ScheduledExecutorUtil.safelyScheduleAtFixedRate(
service,
Expand All @@ -71,7 +71,7 @@ public void bindTo(AbstractMetricService metricService) {
public void unbindFrom(AbstractMetricService metricService) {
// first stop to update the value of some metrics in async way
if (currentServiceFuture != null) {
currentServiceFuture.cancel(false);
currentServiceFuture.cancel(true);
currentServiceFuture = null;
}

Expand Down

0 comments on commit 8f9e28b

Please sign in to comment.