public GroupStatisticsBuilder(GroupStatistics base) { this._buckets = base.getBuckets(); this._byteCount = base.getByteCount(); this._duration = base.getDuration(); this._groupId = base.getGroupId(); this._packetCount = base.getPacketCount(); this._refCount = base.getRefCount(); if (base instanceof GroupStatisticsImpl) { GroupStatisticsImpl _impl = (GroupStatisticsImpl) base; this.augmentation = new HashMap<>(_impl.augmentation); } }
long timeStamp = getTimeStamp(); builder[0].setMetricValue(new Counter64(new BigInteger("" + gs.getRefCount().getValue()))); builder[0].setTimeStamp(timeStamp); builder[1].setMetricValue(new Counter64(new BigInteger("" + gs.getPacketCount().getValue()))); builder[1].setTimeStamp(timeStamp); builder[2].setMetricValue(new Counter64(new BigInteger("" + gs.getByteCount().getValue()))); builder[2].setTimeStamp(timeStamp); } else { List<RecordKeys> recKeys = createRecordKeys(id); getCollector().createTSDRMetricRecordBuilder(nodeID,id, recKeys, "RefCount", "" + gs.getRefCount().getValue(), DataCategory.FLOWGROUPSTATS); getCollector().createTSDRMetricRecordBuilder(nodeID,id, recKeys, "PacketCount", "" + gs.getPacketCount().getValue(), DataCategory.FLOWGROUPSTATS); getCollector().createTSDRMetricRecordBuilder(nodeID,id, recKeys, "ByteCount", "" + gs.getByteCount().getValue(), DataCategory.FLOWGROUPSTATS);
@Override public JsonObject objectToJsonMapper(DataObject ofStat) { JsonObject nodeGroupStatisticsJsonObject = null; GroupStatistics groupStat = (GroupStatistics) ofStat; if (groupStat.getByteCount() != null && groupStat.getDuration() != null && groupStat.getPacketCount() != null && groupStat.getBuckets() != null && groupStat.getGroupId() != null && groupStat.getRefCount() != null) { nodeGroupStatisticsJsonObject = factory.createObjectBuilder() .add(properties.getProperty("STAT_TYPE"), properties.getProperty("GRP_STAT")) .add(properties.getProperty("TIMESTAMP"), System.currentTimeMillis()) .add(properties.getProperty("OFSTATS"), factory.createObjectBuilder() .add(properties.getProperty("BYTE_COUNT"), groupStat.getByteCount().getValue()) .add(properties.getProperty("DURATION_SEC"), groupStat.getDuration().getSecond().getValue()) .add(properties.getProperty("DURATION_NANOSEC"), groupStat.getDuration().getNanosecond().getValue()) .add(properties.getProperty("PACK_COUNT"), groupStat.getPacketCount().getValue()) .add(properties.getProperty("REF_COUNT"), groupStat.getRefCount().getValue()) .add(properties.getProperty("GRP_ID"), groupStat.getGroupId().getValue()) .add(properties.getProperty("BUCK"), createBandStatsJsonArrayObject(groupStat.getBuckets().getBucketCounter()))) .build(); } return nodeGroupStatisticsJsonObject; }
if (other.getBuckets() != null) { return false; } else if(!_buckets.equals(other.getBuckets())) { return false; if (other.getByteCount() != null) { return false; } else if(!_byteCount.equals(other.getByteCount())) { return false; if (other.getDuration() != null) { return false; } else if(!_duration.equals(other.getDuration())) { return false; if (other.getGroupId() != null) { return false; } else if(!_groupId.equals(other.getGroupId())) { return false; if (other.getPacketCount() != null) { return false; } else if(!_packetCount.equals(other.getPacketCount())) { return false;