未验证 提交 da559fb0 编写于 作者: Z ZhangHongYin 提交者: GitHub

[IOTDB-5253] Fix chunkMetadata mem metric (#8661)

* Fix chunkMetadata mem metric

* remove equal and hashcode override
上级 400e099d
......@@ -36,7 +36,7 @@ public class TsFileProcessorInfo {
MetricService.getInstance()
.addMetricSet(
new TsFileProcessorInfoMetrics(
dataRegionInfo.getDataRegion().getDatabaseName(), memCost));
dataRegionInfo.getDataRegion().getDatabaseName(), this));
}
}
......@@ -57,4 +57,9 @@ public class TsFileProcessorInfo {
dataRegionInfo.releaseStorageGroupMemCost(memCost);
memCost = 0L;
}
/** get memCost */
public long getMemCost() {
return memCost;
}
}
......@@ -26,15 +26,14 @@ import org.apache.iotdb.metrics.metricsets.IMetricSet;
import org.apache.iotdb.metrics.utils.MetricLevel;
import org.apache.iotdb.metrics.utils.MetricType;
import java.util.Objects;
public class TsFileProcessorInfoMetrics implements IMetricSet {
private String storageGroupName;
private long memCost;
private TsFileProcessorInfo tsFileProcessorInfo;
public TsFileProcessorInfoMetrics(String storageGroupName, long memCost) {
public TsFileProcessorInfoMetrics(
String storageGroupName, TsFileProcessorInfo tsFileProcessorInfo) {
this.storageGroupName = storageGroupName;
this.memCost = memCost;
this.tsFileProcessorInfo = tsFileProcessorInfo;
}
@Override
......@@ -43,8 +42,8 @@ public class TsFileProcessorInfoMetrics implements IMetricSet {
.createAutoGauge(
Metric.MEM.toString(),
MetricLevel.IMPORTANT,
memCost,
o -> o,
tsFileProcessorInfo,
TsFileProcessorInfo::getMemCost,
Tag.NAME.toString(),
"chunkMetaData_" + storageGroupName);
}
......@@ -58,17 +57,4 @@ public class TsFileProcessorInfoMetrics implements IMetricSet {
Tag.NAME.toString(),
"chunkMetaData_" + storageGroupName);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TsFileProcessorInfoMetrics that = (TsFileProcessorInfoMetrics) o;
return memCost == that.memCost && Objects.equals(storageGroupName, that.storageGroupName);
}
@Override
public int hashCode() {
return Objects.hash(storageGroupName, memCost);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册