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

Commit f2945b90 authored by arunvoddu's avatar arunvoddu
Browse files

[Satellite] Satellite metrics to capture pending message count per datagram type.

Bug:381007377
Flag: EXEMPT MetricEnhance
Test: Built successfully and verified manually

Change-Id: I0e909cb6d9ba36e6f6053ccccb01e110a22c68c9
parent 7ea9db1a
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -223,6 +223,10 @@ public final class SatelliteSessionStats implements Parcelable {
        return mCountOfUserMessagesInQueueToBeSent;
    }

    public void incrementUserMessagesInQueueToBeSent() {
        mCountOfUserMessagesInQueueToBeSent++;
    }

    public long getLatencyOfAllSuccessfulUserMessages() {
        return mLatencyOfSuccessfulUserMessages;
    }
@@ -288,6 +292,18 @@ public final class SatelliteSessionStats implements Parcelable {
        }
    }

    public void updateCountOfUserMessagesInQueueToBeSent(
            @SatelliteManager.DatagramType int datagramType) {
        try {
            datagramStats.putIfAbsent(datagramType, new SatelliteSessionStats.Builder().build());
            SatelliteSessionStats data = datagramStats.get(datagramType);
            data.incrementUserMessagesInQueueToBeSent();
        } catch (Exception e) {
            Log.e("SatelliteSessionStats",
                    "Error while addCountOfUserMessagesInQueueToBeSent: " + e.getMessage());
        }
    }

    public int getCountOfUnsuccessfulUserMessages(@SatelliteManager.DatagramType int datagramType) {
        SatelliteSessionStats data = datagramStats.get(datagramType);
        return data.getCountOfUnsuccessfulUserMessages();