Skip to content

Develoment Plan: Bandwidth consumption addon

Christopher Gamache edited this page Apr 19, 2019 · 3 revisions

Referencing Issue: https://github.com/RocketChat/feature-requests/issues/82

Since this is my first major issue on the project I thought a rough outline of my design plan was in order.

My plans for the UI and the new pages are just to create the wireframes into actual designs and to mimic the code format of other pages already within the app to implement the functionality.

Actually getting and recording the bandwidth consumption is the less straight forward part and what I'm more concerned about getting feedback on. First it looks like we will need a new AnalyticsDao in chat.rocket.android/db. This data base should have fields for, chatroom id, message size, date time, data type(send/receive/control) and maybe also user id. In chat.rocket.android the ConnectionManager under server/infaestructure will need access to this database so it can pass it onto the socket code.

For recording the actual data transmitted I will need to edit code inside rocket.chat.kotlin.sdk since it is already unpacked in chat.rocket.android. For incoming messages the file socket.kt has everything needed and will just have to be modified to accept the AnalyticsDao and record is the user has analytics turned on(already a setting). Outgoing messages are a bit more obscure, some control ones are sent in the previous socket.kt, but actual messages and update to the chatrooms done by the user are created and sent through internal/rest/Message.kt. Both files are part of the larger class rocketChatClient and rocketChatClient is what is created by the connectionManager in chat.rocket.android so that can control the database object. Looking at it right now I'm not sure this covers incoming and outgoing attachments and there might be a separate file that needs editing in rocket.chat.kotlin.sdk to record those.

Alright this is starting to get long and that's not my intention so let me know what you think.