Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 819cf172 authored by En-Shuo Hsu's avatar En-Shuo Hsu Committed by Automerger Merge Worker
Browse files

Merge "floss: metrics: start sending hfp pkt loss metrics" am: aab922b2

parents 1e488edf aab922b2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -175,6 +175,9 @@ void LogMetricA2dpPlaybackEvent(const Address& address, int playback_state, int
  }
}

void LogMetricHfpPacketLossStats(
    const Address& address, int num_decoded_frames, double packet_loss_ratio) {}

void LogMetricReadRssiResult(const Address& address, uint16_t handle, uint32_t cmd_status, int8_t rssi) {
  int metric_id = 0;
  if (!address.IsEmpty()) {
+24 −0
Original line number Diff line number Diff line
@@ -85,6 +85,30 @@ void LogMetricA2dpAudioOverrunEvent(
      .Record();
}

void LogMetricHfpPacketLossStats(
    const Address& address, int num_decoded_frames, double packet_loss_ratio) {
  std::string boot_id;
  std::string addr_string;

  if (!metrics::GetBootId(&boot_id)) return;

  addr_string = address.ToString();

  LOG_DEBUG(
      "HfpPacketLoss: %s, %s, %d, %f",
      boot_id.c_str(),
      addr_string.c_str(),
      num_decoded_frames,
      packet_loss_ratio);

  ::metrics::structured::events::bluetooth::BluetoothHfpPacketLoss()
      .SetBootId(boot_id)
      .SetDeviceId(addr_string)
      .SetDecodedFrames(num_decoded_frames)
      .SetPacketLossRatio(packet_loss_ratio)
      .Record();
}

void LogMetricReadRssiResult(
    const Address& address, uint16_t handle, uint32_t cmd_status, int8_t rssi) {}

+3 −0
Original line number Diff line number Diff line
@@ -56,6 +56,9 @@ void LogMetricA2dpAudioOverrunEvent(
    int num_dropped_encoded_frames,
    int num_dropped_encoded_bytes) {}

void LogMetricHfpPacketLossStats(
    const Address& address, int num_decoded_frames, double packet_loss_ratio) {}

void LogMetricReadRssiResult(const Address& address, uint16_t handle, uint32_t cmd_status, int8_t rssi) {}

void LogMetricReadFailedContactCounterResult(
+3 −0
Original line number Diff line number Diff line
@@ -100,6 +100,9 @@ void LogMetricSmpPairingEvent(

void LogMetricA2dpPlaybackEvent(const Address& address, int playback_state, int audio_coding_mode) {}

void LogMetricHfpPacketLossStats(
    const Address& address, int num_decoded_frames, double packet_loss_ratio) {}

void LogMetricBluetoothHalCrashReason(
    const Address& address, uint32_t error_code, uint32_t vendor_error_code) {}

+10 −0
Original line number Diff line number Diff line
@@ -120,6 +120,16 @@ void LogMetricA2dpAudioOverrunEvent(
 */
void LogMetricA2dpPlaybackEvent(const hci::Address& address, int playback_state, int audio_coding_mode);

/**
 * Log HFP audio capture packet loss statistics
 *
 * @param address HFP device associated with this stats
 * @param num_decoded_frames number of decoded frames
 * @param packet_loss_ratio ratio of packet loss frames
 */
void LogMetricHfpPacketLossStats(
    const hci::Address& address, int num_decoded_frames, double packet_loss_ratio);

/**
 * Log read RSSI result
 *
Loading