Data Models for RCA (#125)

Signed-off-by: zhiqiand <zhiqian@fb.com>
Signed-off-by: Jeffrey Han <39203126+elludraon@users.noreply.github.com>
Co-authored-by: Jeffrey Han <39203126+elludraon@users.noreply.github.com>
This commit is contained in:
zhiqiand
2022-11-21 18:01:44 -08:00
committed by GitHub
parent d73eb23920
commit ba8c156e72
3 changed files with 176 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.openwifi.librca.stats;
import java.util.List;
/**
* Aggregated statistics for each client.
* Mainly handle KPI and metric calculations.
*/
public class ClientStats {
/** Client MAC */
public String station;
/** LinkStats that are of the same station(client) */
public List<LinkStats> connections;
}

View File

@@ -0,0 +1,75 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.openwifi.librca.stats;
import java.util.List;
/**
* Aggregation Statistics Model of InputStats.
* Aggregate by bssid, station and RadioConfig.
*/
public class LinkStats {
public static class RadioConfig {
public int channel;
public int channelWidth;
public int txPower;
public String phy;
}
public static class AssociationInfo {
/** Rate information for receive/transmit data rate. */
public static class Rate {
public long bitRate;
public int chWidth;
public int mcs;
}
public long connected;
public long inactive;
public int rssi;
public long rxBytes;
public long rxPackets;
public Rate rxRate;
public long txBytes;
public long txDuration;
public long txFailed;
public long txPackets;
public Rate txRate;
public long txRetries;
public int ackSignal;
public int ackSignalAvg;
// The metrics below are from Interface the client was connected to.
public long txPacketsCounters;
public long txErrorsCounters;
public long txDroppedCounters;
// The metrics below are from the radio the client was associated to.
public long activeMsRadio;
public long busyMsRadio;
public long noiseRadio;
public long receiveMsRadio;
public long transmitMsRadio;
/** Unix time in milliseconds */
public long timestamp;
}
/** BSSID of the AP radio */
public String bssid;
/** Client MAC */
public String station;
/** Radio configuration parameters */
public RadioConfig radioConfig;
/** Association list */
public List<AssociationInfo> associationInfoList;
}

View File

@@ -0,0 +1,78 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.openwifi.librca.stats.inputs;
/**
* Input data model.
*
* TODO: very incomplete
*/
public class InputStats {
/** Radio parameters */
public static class Radio {
public long active_ms;
public long busy_ms;
public int channel;
public String channel_width;
public long noise;
public String phy;
public long receive_ms;
public long transmit_ms;
public int tx_power;
}
public static class SSID {
public static class Association {
public static class Rate {
public long bitrate;
public int chwidth;
public int mcs;
}
public String bssid; // bssid of the AP radio
public String station; // client MAC
public long connected;
public long inactive;
public int rssi;
public long rx_bytes;
public long rx_packets;
public Rate rx_rate;
public long tx_bytes;
public long tx_duration;
public long tx_failed;
public long tx_offset;
public long tx_packets;
public Rate tx_rate;
public long tx_retries;
public int ack_signal;
public int ack_signal_avg;
}
public Association[] associations;
public Radio radio;
}
/** Counters are for the wireless interface as a whole */
public static class Counters {
public long rx_bytes;
public long rx_packets;
public long rx_errors;
public long rx_dropped;
public long tx_bytes;
public long tx_packets;
public long tx_errors;
public long tx_dropped;
}
public SSID[] ssids;
public Counters counters;
/** Unix time in milliseconds */
public long timestamp;
}