openr/py/openr/cli/commands/fib.py [504:548]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def get_subscriber_row(self, stream_session_info):
        """
        Takes StreamSubscriberInfo from thrift and returns list[str] (aka row)
        representing the subscriber
        """

        uptime = "unknown"
        last_msg_time = "unknown"
        if (
            stream_session_info.uptime is not None
            and stream_session_info.last_msg_sent_time is not None
        ):
            uptime_str = str(
                datetime.timedelta(milliseconds=stream_session_info.uptime)
            )
            last_msg_time_str = convertTime(stream_session_info.last_msg_sent_time)
            uptime = uptime_str.split(".")[0]
            last_msg_time = last_msg_time_str

        # assert isinstance(stream_session_info, StreamSubscriberInfo)
        row = [
            stream_session_info.subscriber_id,
            uptime,
            stream_session_info.total_streamed_msgs,
            last_msg_time,
        ]
        return row

    def run(self, *args, **kwargs) -> int:
        async def _wrapper() -> int:
            client_type = ClientType.THRIFT_ROCKET_CLIENT_TYPE
            async with get_openr_ctrl_cpp_client(
                self.host, self.cli_opts, client_type
            ) as client:
                await self._run(client, *args, **kwargs)
            return 0

        return asyncio.run(_wrapper())

    async def _run(
        self,
        client: OpenrCtrlCppClient,
        *args,
        **kwargs,
    ) -> None:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



openr/py/openr/cli/commands/kvstore.py [1420:1463]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def get_subscriber_row(self, stream_session_info):
        """
        Takes StreamSubscriberInfo from thrift and returns list[str] (aka row)
        representing the subscriber
        """

        uptime = "unknown"
        last_msg_time = "unknown"
        if (
            stream_session_info.uptime is not None
            and stream_session_info.last_msg_sent_time is not None
        ):
            uptime_str = str(
                datetime.timedelta(milliseconds=stream_session_info.uptime)
            )
            last_msg_time_str = convertTime(stream_session_info.last_msg_sent_time)
            uptime = uptime_str.split(".")[0]
            last_msg_time = last_msg_time_str

        row = [
            stream_session_info.subscriber_id,
            uptime,
            stream_session_info.total_streamed_msgs,
            last_msg_time,
        ]
        return row

    def run(self, *args, **kwargs) -> int:
        async def _wrapper() -> int:
            client_type = ClientType.THRIFT_ROCKET_CLIENT_TYPE
            async with get_openr_ctrl_cpp_client(
                self.host, self.cli_opts, client_type
            ) as client:
                await self._run(client, *args, **kwargs)
            return 0

        return asyncio.run(_wrapper())

    async def _run(
        self,
        client: OpenrCtrlCppClient,
        *args,
        **kwargs,
    ) -> None:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



