Skip to content

Commit

Permalink
Fix pointNum in MultiDeviceBatch (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
YangYumings authored Sep 27, 2024
1 parent 4cf5083 commit c689751
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
package cn.edu.tsinghua.iot.benchmark.entity.Batch;

import cn.edu.tsinghua.iot.benchmark.entity.Record;
import cn.edu.tsinghua.iot.benchmark.entity.Sensor;
import cn.edu.tsinghua.iot.benchmark.entity.enums.ColumnCategory;
import cn.edu.tsinghua.iot.benchmark.schema.schemaImpl.DeviceSchema;

import java.util.ArrayList;
Expand Down Expand Up @@ -80,11 +82,14 @@ public int getColIndex() {
@Override
public long pointNum() {
long pointNum = 0;
for (List<Record> recordList : recordLists) {
for (Record record : recordList) {
pointNum += record.size();
long measureNum = 0;
List<Sensor> sensors = deviceSchemas.get(0).getSensors();
for (Sensor sensor : sensors) {
if (sensor.getColumnCategory() == ColumnCategory.MEASUREMENT) {
measureNum++;
}
}
pointNum = (measureNum * recordLists.size() * recordLists.get(0).size());
return pointNum;
}

Expand Down

0 comments on commit c689751

Please sign in to comment.