mirror of
https://github.com/Telecominfraproject/wlan-cloud-services.git
synced 2026-03-20 21:39:21 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95a07188d5 | ||
|
|
6839ff3e97 | ||
|
|
299f59767e | ||
|
|
936aeae135 | ||
|
|
5b3d05bc21 | ||
|
|
ee3c62559a | ||
|
|
d3bb9f6e51 | ||
|
|
a1ebf265f9 | ||
|
|
64b1432251 | ||
|
|
e74570121c |
@@ -4982,10 +4982,6 @@ components:
|
||||
|
||||
ClientMetrics:
|
||||
properties:
|
||||
secondsSinceLastRecv:
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxPackets:
|
||||
type: integer
|
||||
format: int64
|
||||
@@ -5026,12 +5022,6 @@ components:
|
||||
|
||||
sessionId:
|
||||
type: string
|
||||
|
||||
classificationName:
|
||||
type: string
|
||||
|
||||
channelBandWidth:
|
||||
$ref: '#/components/schemas/ChannelBandwidth'
|
||||
|
||||
averageTxRate:
|
||||
type: number
|
||||
@@ -5048,21 +5038,11 @@ components:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
rxLastRssi:
|
||||
description: The RSSI of last frame received.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxNoFcsErr:
|
||||
description: The number of received frames without FCS errors.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxData:
|
||||
description: The number of received data frames.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
|
||||
rxBytes:
|
||||
description: The number of received bytes.
|
||||
type: integer
|
||||
|
||||
@@ -62,7 +62,7 @@ public class ElementRadioConfiguration extends BaseJsonModel
|
||||
|
||||
if (radioType == RadioType.is5GHz) {
|
||||
returnValue.setChannelNumber(36);
|
||||
returnValue.setBackupChannelNumber(149);
|
||||
returnValue.setBackupChannelNumber(44);
|
||||
} else if (radioType == RadioType.is5GHzL) {
|
||||
returnValue.setChannelNumber(36);
|
||||
returnValue.setBackupChannelNumber(44);
|
||||
|
||||
@@ -932,9 +932,9 @@ public class EquipmentServiceRemoteTest extends BaseRemoteTest {
|
||||
assertEquals(11, radioMap.get(RadioType.is2dot4GHz).getManualBackupChannelNumber().intValue());
|
||||
|
||||
assertEquals(36, radioMap.get(RadioType.is5GHz).getChannelNumber().intValue());
|
||||
assertEquals(149, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
|
||||
assertEquals(44, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
|
||||
assertEquals(36, radioMap.get(RadioType.is5GHz).getManualChannelNumber().intValue());
|
||||
assertEquals(149, radioMap.get(RadioType.is5GHz).getManualBackupChannelNumber().intValue());
|
||||
assertEquals(44, radioMap.get(RadioType.is5GHz).getManualBackupChannelNumber().intValue());
|
||||
|
||||
Map<RadioType, Integer> primaryChannels = new EnumMap<>(RadioType.class);
|
||||
Map<RadioType, Integer> backupChannels = new EnumMap<>(RadioType.class);
|
||||
@@ -970,7 +970,7 @@ public class EquipmentServiceRemoteTest extends BaseRemoteTest {
|
||||
assertEquals(6, radioMap.get(RadioType.is2dot4GHz).getManualBackupChannelNumber().intValue());
|
||||
|
||||
assertEquals(36, radioMap.get(RadioType.is5GHz).getChannelNumber().intValue());
|
||||
assertEquals(149, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
|
||||
assertEquals(44, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
|
||||
assertEquals(40, radioMap.get(RadioType.is5GHz).getManualChannelNumber().intValue());
|
||||
assertEquals(48, radioMap.get(RadioType.is5GHz).getManualBackupChannelNumber().intValue());
|
||||
|
||||
@@ -980,7 +980,7 @@ public class EquipmentServiceRemoteTest extends BaseRemoteTest {
|
||||
|
||||
backupChannels.clear();
|
||||
backupChannels.put(RadioType.is2dot4GHz, 6);
|
||||
backupChannels.put(RadioType.is5GHz, 44);
|
||||
backupChannels.put(RadioType.is5GHz, 149);
|
||||
|
||||
autoChannelSelections.clear();
|
||||
autoChannelSelections.put(RadioType.is2dot4GHz, true);
|
||||
@@ -1007,7 +1007,7 @@ public class EquipmentServiceRemoteTest extends BaseRemoteTest {
|
||||
assertEquals(6, radioMap.get(RadioType.is2dot4GHz).getManualBackupChannelNumber().intValue());
|
||||
|
||||
assertEquals(161, radioMap.get(RadioType.is5GHz).getChannelNumber().intValue());
|
||||
assertEquals(44, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
|
||||
assertEquals(149, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
|
||||
assertEquals(40, radioMap.get(RadioType.is5GHz).getManualChannelNumber().intValue());
|
||||
assertEquals(48, radioMap.get(RadioType.is5GHz).getManualBackupChannelNumber().intValue());
|
||||
|
||||
|
||||
@@ -5175,9 +5175,6 @@ components:
|
||||
properties:
|
||||
model_type:
|
||||
type: string
|
||||
secondsSinceLastRecv:
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxPackets:
|
||||
type: integer
|
||||
@@ -5216,12 +5213,6 @@ components:
|
||||
rssi:
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
classificationName:
|
||||
type: string
|
||||
|
||||
channelBandWidth:
|
||||
$ref: '#/components/schemas/ChannelBandwidth'
|
||||
|
||||
averageTxRate:
|
||||
type: number
|
||||
@@ -5238,21 +5229,11 @@ components:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
rxLastRssi:
|
||||
description: The RSSI of last frame received.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxNoFcsErr:
|
||||
description: The number of received frames without FCS errors.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxData:
|
||||
description: The number of received data frames.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
rxBytes:
|
||||
description: The number of received bytes.
|
||||
type: integer
|
||||
|
||||
@@ -116,7 +116,7 @@ public class RfElementConfiguration extends BaseJsonModel {
|
||||
ret.setMinAutoCellSize(MIN_CELL_SIZE_MAP.get(radioType));
|
||||
ret.setMaxAutoCellSize(MAX_CELL_SIZE_MAP.get(radioType));
|
||||
if (radioType == RadioType.is5GHz || radioType == RadioType.is5GHzL || radioType == RadioType.is5GHzU) {
|
||||
ret.setChannelBandwidth(ChannelBandwidth.is80MHz);
|
||||
ret.setChannelBandwidth(ChannelBandwidth.is40MHz);
|
||||
ret.setRadioMode(RadioMode.modeAC);
|
||||
} else {
|
||||
ret.setChannelBandwidth(ChannelBandwidth.is20MHz);
|
||||
|
||||
@@ -114,10 +114,6 @@ public abstract class BaseServiceMetricDatastoreTest {
|
||||
serviceMetric.setEquipmentId(testSequence.incrementAndGet());
|
||||
serviceMetric.setClientMac(testSequence.incrementAndGet());
|
||||
serviceMetric.setCreatedTimestamp(baseTimestamp - 100000 + testSequence.incrementAndGet());
|
||||
|
||||
ClientMetrics details2 = new ClientMetrics();
|
||||
details2.setClassificationName("qr_"+apNameIdx);
|
||||
serviceMetric.setDetails(details2);
|
||||
|
||||
apNameIdx++;
|
||||
|
||||
@@ -132,10 +128,6 @@ public abstract class BaseServiceMetricDatastoreTest {
|
||||
serviceMetric.setEquipmentId(testSequence.incrementAndGet());
|
||||
serviceMetric.setClientMac(testSequence.incrementAndGet());
|
||||
serviceMetric.setCreatedTimestamp(baseTimestamp + testSequence.incrementAndGet());
|
||||
|
||||
ClientMetrics details2 = new ClientMetrics();
|
||||
details2.setClassificationName("qr_"+apNameIdx);
|
||||
serviceMetric.setDetails(details2);
|
||||
|
||||
apNameIdx++;
|
||||
|
||||
@@ -150,10 +142,6 @@ public abstract class BaseServiceMetricDatastoreTest {
|
||||
serviceMetric.setEquipmentId(testSequence.incrementAndGet());
|
||||
serviceMetric.setClientMac(testSequence.incrementAndGet());
|
||||
serviceMetric.setCreatedTimestamp(baseTimestamp - 100000 + testSequence.incrementAndGet());
|
||||
|
||||
ClientMetrics details2 = new ClientMetrics();
|
||||
details2.setClassificationName("qr_"+apNameIdx);
|
||||
serviceMetric.setDetails(details2);
|
||||
|
||||
apNameIdx++;
|
||||
|
||||
@@ -200,43 +188,18 @@ public abstract class BaseServiceMetricDatastoreTest {
|
||||
assertTrue(page6.getContext().isLastPage());
|
||||
assertTrue(page7.getContext().isLastPage());
|
||||
|
||||
List<String> expectedPage3Strings = new ArrayList<>(Arrays.asList(new String[]{"qr_20", "qr_21", "qr_22", "qr_23", "qr_24", "qr_25", "qr_26", "qr_27", "qr_28", "qr_29" }));
|
||||
List<String> actualPage3Strings = new ArrayList<>();
|
||||
page3.getItems().stream().forEach( ce -> actualPage3Strings.add(((ClientMetrics) ce.getDetails()).getClassificationName()) );
|
||||
|
||||
assertEquals(expectedPage3Strings, actualPage3Strings);
|
||||
|
||||
//test first page of the results with empty sort order -> default sort order (by createdTimestamp ascending)
|
||||
PaginationResponse<ServiceMetric> page1EmptySort = testInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, Collections.emptyList(), context);
|
||||
assertEquals(10, page1EmptySort.getItems().size());
|
||||
|
||||
List<String> expectedPage1EmptySortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
|
||||
List<String> actualPage1EmptySortStrings = new ArrayList<>();
|
||||
page1EmptySort.getItems().stream().forEach( ce -> actualPage1EmptySortStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
|
||||
|
||||
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
|
||||
|
||||
//test first page of the results with null sort order -> default sort order (by createdTimestamp ascending)
|
||||
PaginationResponse<ServiceMetric> page1NullSort = testInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, null, context);
|
||||
assertEquals(10, page1NullSort.getItems().size());
|
||||
|
||||
List<String> expectedPage1NullSortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
|
||||
List<String> actualPage1NullSortStrings = new ArrayList<>();
|
||||
page1NullSort.getItems().stream().forEach( ce -> actualPage1NullSortStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
|
||||
|
||||
assertEquals(expectedPage1NullSortStrings, actualPage1NullSortStrings);
|
||||
|
||||
|
||||
//test first page of the results with sort descending order by a equipmentId property
|
||||
PaginationResponse<ServiceMetric> page1SingleSortDesc = testInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, Collections.singletonList(new ColumnAndSort("equipmentId", SortOrder.desc)), context);
|
||||
assertEquals(10, page1SingleSortDesc.getItems().size());
|
||||
|
||||
List<String> expectedPage1SingleSortDescStrings = getPagination_expectedPage1SingleSortDescStrings();
|
||||
List<String> actualPage1SingleSortDescStrings = new ArrayList<>();
|
||||
page1SingleSortDesc.getItems().stream().forEach( ce -> actualPage1SingleSortDescStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
|
||||
|
||||
assertEquals(expectedPage1SingleSortDescStrings, actualPage1SingleSortDescStrings);
|
||||
|
||||
used_equipmentIds.forEach(eqId -> testInterface.delete(customerId_1, eqId, System.currentTimeMillis()));
|
||||
used_equipmentIds.forEach(eqId -> testInterface.delete(customerId_2, eqId, System.currentTimeMillis()));
|
||||
|
||||
@@ -336,9 +299,8 @@ public abstract class BaseServiceMetricDatastoreTest {
|
||||
serviceMetric.setCreatedTimestamp(baseTimestamp - testSequence.incrementAndGet());
|
||||
|
||||
ClientMetrics details2 = new ClientMetrics();
|
||||
details2.setClassificationName("qr_"+apNameIdx);
|
||||
serviceMetric.setDetails(details2);
|
||||
|
||||
|
||||
testInterface.create(serviceMetric);
|
||||
|
||||
//third metric - neighbour
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.telecominfraproject.wlan.servicemetric.client.models;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.ChannelBandwidth;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDataType;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDetails;
|
||||
@@ -18,19 +16,14 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
|
||||
private static final long serialVersionUID = 7242365268669169773L;
|
||||
|
||||
private Integer secondsSinceLastRecv;
|
||||
|
||||
private Long numRxPackets;
|
||||
private Long numTxPackets;
|
||||
private Long numRxBytes;
|
||||
private Long numTxBytes;
|
||||
private Integer txRetries;
|
||||
private Integer rxDuplicatePackets;
|
||||
private int[] rates;
|
||||
private Integer snr;
|
||||
private Integer rssi;
|
||||
private String classificationName;
|
||||
ChannelBandwidth channelBandWidth;
|
||||
|
||||
private Double averageTxRate;
|
||||
private Double averageRxRate;
|
||||
@@ -38,21 +31,11 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
private Long numTxFramesTransmitted;
|
||||
private Long numRxFramesReceived;
|
||||
|
||||
/**
|
||||
* The RSSI of last frame received.
|
||||
*/
|
||||
private Integer rxLastRssi;
|
||||
|
||||
/**
|
||||
* The number of received frames without FCS errors.
|
||||
*/
|
||||
private Integer numRxNoFcsErr;
|
||||
|
||||
/**
|
||||
* The number of received data frames.
|
||||
*/
|
||||
private Integer numRxData;
|
||||
|
||||
/**
|
||||
* The number of received bytes.
|
||||
*/
|
||||
@@ -90,13 +73,7 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
|
||||
@Override
|
||||
public ClientMetrics clone() {
|
||||
ClientMetrics ret = (ClientMetrics) super.clone();
|
||||
|
||||
if(this.rates!=null){
|
||||
ret.rates = this.rates.clone();
|
||||
}
|
||||
|
||||
return ret;
|
||||
return (ClientMetrics) super.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,15 +89,14 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
}
|
||||
ClientMetrics other = (ClientMetrics) obj;
|
||||
return Objects.equals(averageRxRate, other.averageRxRate) && Objects.equals(averageTxRate, other.averageTxRate)
|
||||
&& this.channelBandWidth == other.channelBandWidth && Objects.equals(classificationName, other.classificationName)
|
||||
&& Objects.equals(numRxBytes, other.numRxBytes) && Objects.equals(numRxData, other.numRxData)
|
||||
&& Objects.equals(numRxBytes, other.numRxBytes)
|
||||
&& Objects.equals(numRxFramesReceived, other.numRxFramesReceived) && Objects.equals(numRxNoFcsErr, other.numRxNoFcsErr)
|
||||
&& Objects.equals(numRxPackets, other.numRxPackets) && Objects.equals(numRxRetry, other.numRxRetry)
|
||||
&& Objects.equals(numTxBytes, other.numTxBytes) && Objects.equals(numTxDataRetries, other.numTxDataRetries)
|
||||
&& Objects.equals(numTxDropped, other.numTxDropped) && Objects.equals(numTxFramesTransmitted, other.numTxFramesTransmitted)
|
||||
&& Objects.equals(numTxPackets, other.numTxPackets) && this.radioType == other.radioType
|
||||
&& Arrays.equals(rates, other.rates) && Objects.equals(rssi, other.rssi) && Objects.equals(rxBytes, other.rxBytes)
|
||||
&& Objects.equals(rxDuplicatePackets, other.rxDuplicatePackets) && Objects.equals(rxLastRssi, other.rxLastRssi)
|
||||
&& Objects.equals(rssi, other.rssi) && Objects.equals(rxBytes, other.rxBytes)
|
||||
&& Objects.equals(rxDuplicatePackets, other.rxDuplicatePackets)
|
||||
&& Objects.equals(snr, other.snr) && Objects.equals(txRetries, other.txRetries);
|
||||
}
|
||||
|
||||
@@ -128,10 +104,6 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
return numRxBytes;
|
||||
}
|
||||
|
||||
public Integer getNumRxData() {
|
||||
return numRxData;
|
||||
}
|
||||
|
||||
public Integer getNumRxNoFcsErr() {
|
||||
return numRxNoFcsErr;
|
||||
}
|
||||
@@ -164,10 +136,6 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
return radioType;
|
||||
}
|
||||
|
||||
public int[] getRates() {
|
||||
return rates;
|
||||
}
|
||||
|
||||
public Integer getRssi() {
|
||||
return rssi;
|
||||
}
|
||||
@@ -180,10 +148,6 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
return rxDuplicatePackets;
|
||||
}
|
||||
|
||||
public Integer getRxLastRssi() {
|
||||
return rxLastRssi;
|
||||
}
|
||||
|
||||
public Integer getSnr() {
|
||||
return snr;
|
||||
}
|
||||
@@ -196,12 +160,11 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + Arrays.hashCode(this.rates);
|
||||
result = prime * result + Objects.hash(averageRxRate, averageTxRate, channelBandWidth,
|
||||
classificationName, numRxBytes, numRxData, numRxFramesReceived,
|
||||
result = prime * result + Objects.hash(averageRxRate, averageTxRate,
|
||||
numRxBytes, numRxFramesReceived,
|
||||
numRxNoFcsErr, numRxPackets, numRxRetry, numTxBytes,
|
||||
numTxDataRetries, numTxDropped, numTxFramesTransmitted, numTxPackets,
|
||||
radioType, rssi, rxBytes, rxDuplicatePackets, rxLastRssi, snr, txRetries);
|
||||
radioType, rssi, rxBytes, rxDuplicatePackets, snr, txRetries);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -210,7 +173,7 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
if (super.hasUnsupportedValue()) {
|
||||
return true;
|
||||
}
|
||||
if (RadioType.isUnsupported(radioType) || (ChannelBandwidth.isUnsupported(this.channelBandWidth))) {
|
||||
if (RadioType.isUnsupported(radioType)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -220,10 +183,6 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
this.numRxBytes = numRxBytes;
|
||||
}
|
||||
|
||||
public void setNumRxData(Integer numRxData) {
|
||||
this.numRxData = numRxData;
|
||||
}
|
||||
|
||||
public void setNumRxNoFcsErr(Integer numRxNoFcsErr) {
|
||||
this.numRxNoFcsErr = numRxNoFcsErr;
|
||||
}
|
||||
@@ -256,10 +215,6 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
this.radioType = radioType;
|
||||
}
|
||||
|
||||
public void setRates(int[] rates) {
|
||||
this.rates = rates;
|
||||
}
|
||||
|
||||
public void setRssi(Integer rssi) {
|
||||
this.rssi = rssi;
|
||||
}
|
||||
@@ -272,10 +227,6 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
this.rxDuplicatePackets = rxDuplicatePackets;
|
||||
}
|
||||
|
||||
public void setRxLastRssi(Integer rxLastRssi) {
|
||||
this.rxLastRssi = rxLastRssi;
|
||||
}
|
||||
|
||||
public void setSnr(Integer snr) {
|
||||
this.snr = snr;
|
||||
}
|
||||
@@ -300,22 +251,6 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
this.numRxFramesReceived = numRxFramesReceived;
|
||||
}
|
||||
|
||||
public String getClassificationName() {
|
||||
return classificationName;
|
||||
}
|
||||
|
||||
public void setClassificationName(String classificationName) {
|
||||
this.classificationName = classificationName;
|
||||
}
|
||||
|
||||
public ChannelBandwidth getChannelBandWidth() {
|
||||
return channelBandWidth;
|
||||
}
|
||||
|
||||
public void setChannelBandWidth(ChannelBandwidth channelBandWidth) {
|
||||
this.channelBandWidth = channelBandWidth;
|
||||
}
|
||||
|
||||
public Double getAverageTxRate() {
|
||||
return averageTxRate;
|
||||
}
|
||||
@@ -332,14 +267,6 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
this.averageRxRate = averageRxRate;
|
||||
}
|
||||
|
||||
public Integer getSecondsSinceLastRecv() {
|
||||
return secondsSinceLastRecv;
|
||||
}
|
||||
|
||||
public void setSecondsSinceLastRecv(Integer secondsSinceLastRecv) {
|
||||
this.secondsSinceLastRecv = secondsSinceLastRecv;
|
||||
}
|
||||
|
||||
public Integer getPeriodLengthSec() {
|
||||
return periodLengthSec;
|
||||
}
|
||||
|
||||
@@ -127,10 +127,6 @@ public class ServiceMetricServiceRemoteTest extends BaseRemoteTest {
|
||||
serviceMetric.setClientMac(getNextEquipmentId());
|
||||
serviceMetric.setCreatedTimestamp(baseTimestamp - 100000 + getNextEquipmentId());
|
||||
|
||||
ClientMetrics details2 = new ClientMetrics();
|
||||
details2.setClassificationName("qr_"+apNameIdx);
|
||||
serviceMetric.setDetails(details2);
|
||||
|
||||
apNameIdx++;
|
||||
|
||||
remoteInterface.create(serviceMetric);
|
||||
@@ -144,10 +140,6 @@ public class ServiceMetricServiceRemoteTest extends BaseRemoteTest {
|
||||
serviceMetric.setClientMac(getNextEquipmentId());
|
||||
serviceMetric.setCreatedTimestamp(baseTimestamp + getNextEquipmentId());
|
||||
|
||||
ClientMetrics details2 = new ClientMetrics();
|
||||
details2.setClassificationName("qr_"+apNameIdx);
|
||||
serviceMetric.setDetails(details2);
|
||||
|
||||
apNameIdx++;
|
||||
|
||||
remoteInterface.create(serviceMetric);
|
||||
@@ -161,10 +153,6 @@ public class ServiceMetricServiceRemoteTest extends BaseRemoteTest {
|
||||
serviceMetric.setClientMac(getNextEquipmentId());
|
||||
serviceMetric.setCreatedTimestamp(baseTimestamp - 100000 + getNextEquipmentId());
|
||||
|
||||
ClientMetrics details2 = new ClientMetrics();
|
||||
details2.setClassificationName("qr_"+apNameIdx);
|
||||
serviceMetric.setDetails(details2);
|
||||
|
||||
apNameIdx++;
|
||||
|
||||
remoteInterface.create(serviceMetric);
|
||||
@@ -209,43 +197,18 @@ public class ServiceMetricServiceRemoteTest extends BaseRemoteTest {
|
||||
assertTrue(page6.getContext().isLastPage());
|
||||
assertTrue(page7.getContext().isLastPage());
|
||||
|
||||
List<String> expectedPage3Strings = new ArrayList<>(Arrays.asList(new String[]{"qr_20", "qr_21", "qr_22", "qr_23", "qr_24", "qr_25", "qr_26", "qr_27", "qr_28", "qr_29" }));
|
||||
List<String> actualPage3Strings = new ArrayList<>();
|
||||
page3.getItems().stream().forEach( ce -> actualPage3Strings.add(((ClientMetrics) ce.getDetails()).getClassificationName()) );
|
||||
|
||||
assertEquals(expectedPage3Strings, actualPage3Strings);
|
||||
|
||||
//test first page of the results with empty sort order -> default sort order (by createdTimestamp ascending)
|
||||
PaginationResponse<ServiceMetric> page1EmptySort = remoteInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, Collections.emptyList(), context);
|
||||
assertEquals(10, page1EmptySort.getItems().size());
|
||||
|
||||
List<String> expectedPage1EmptySortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
|
||||
List<String> actualPage1EmptySortStrings = new ArrayList<>();
|
||||
page1EmptySort.getItems().stream().forEach( ce -> actualPage1EmptySortStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
|
||||
|
||||
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
|
||||
|
||||
//test first page of the results with null sort order -> default sort order (by createdTimestamp ascending)
|
||||
PaginationResponse<ServiceMetric> page1NullSort = remoteInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, null, context);
|
||||
assertEquals(10, page1NullSort.getItems().size());
|
||||
|
||||
List<String> expectedPage1NullSortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
|
||||
List<String> actualPage1NullSortStrings = new ArrayList<>();
|
||||
page1NullSort.getItems().stream().forEach( ce -> actualPage1NullSortStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
|
||||
|
||||
assertEquals(expectedPage1NullSortStrings, actualPage1NullSortStrings);
|
||||
|
||||
|
||||
//test first page of the results with sort descending order by a equipmentId property
|
||||
PaginationResponse<ServiceMetric> page1SingleSortDesc = remoteInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, Collections.singletonList(new ColumnAndSort("equipmentId", SortOrder.desc)), context);
|
||||
assertEquals(10, page1SingleSortDesc.getItems().size());
|
||||
|
||||
List<String> expectedPage1SingleSortDescStrings = new ArrayList< >(Arrays.asList(new String[]{"qr_49", "qr_48", "qr_47", "qr_46", "qr_45", "qr_44", "qr_43", "qr_42", "qr_41", "qr_40" }));
|
||||
List<String> actualPage1SingleSortDescStrings = new ArrayList<>();
|
||||
page1SingleSortDesc.getItems().stream().forEach( ce -> actualPage1SingleSortDescStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
|
||||
|
||||
assertEquals(expectedPage1SingleSortDescStrings, actualPage1SingleSortDescStrings);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -338,7 +301,6 @@ public class ServiceMetricServiceRemoteTest extends BaseRemoteTest {
|
||||
serviceMetric.setCreatedTimestamp(baseTimestamp - getNextEquipmentId());
|
||||
|
||||
ClientMetrics details2 = new ClientMetrics();
|
||||
details2.setClassificationName("qr_"+apNameIdx);
|
||||
serviceMetric.setDetails(details2);
|
||||
|
||||
remoteInterface.create(serviceMetric);
|
||||
|
||||
@@ -213,11 +213,7 @@ components:
|
||||
- SGI# Short Guard Interval
|
||||
|
||||
ClientMetrics:
|
||||
properties:
|
||||
secondsSinceLastRecv:
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
properties:
|
||||
numRxPackets:
|
||||
type: integer
|
||||
format: int64
|
||||
@@ -256,12 +252,6 @@ components:
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
classificationName:
|
||||
type: string
|
||||
|
||||
channelBandWidth:
|
||||
$ref: '#/components/schemas/ChannelBandwidth'
|
||||
|
||||
averageTxRate:
|
||||
type: number
|
||||
format: double
|
||||
@@ -277,22 +267,11 @@ components:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
rxLastRssi:
|
||||
description: The RSSI of last frame received.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxNoFcsErr:
|
||||
description: The number of received frames without FCS errors.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxData:
|
||||
description: The number of received data frames.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
|
||||
rxBytes:
|
||||
description: The number of received bytes.
|
||||
type: integer
|
||||
|
||||
Reference in New Issue
Block a user