muxable / stream-dashboard

12 stars 1 forks source link

Design a graph data type schema #19

Closed kevmo314 closed 3 years ago

kevmo314 commented 3 years ago

The schema to represent the underlying data in the graphs

lets create model in typescript'

KeN095 commented 3 years ago

For a single/multi line chart:

{ accountID: string streamID: string modem(1...n ): [ modem1 : modem_upstream: integer modem_downstream: integer ... ]

bitrate: integer audio_bitrate: integer ping: integer packetLoss: integer streamTitle: string startDate: Date() endDate: Date() }

Title of the graph will be the stream title and startDate ( ex: Stream 1 (11/12/2021) ) x-axis will have the times (time scale on x axis decided on startDate/endDate) while the y axis have bitrate numbers

i dont think stream title would be necessary as it could be scraped off of the user, but not sure

KeN095 commented 3 years ago

We can also have a pie chart to represent uptime and down time per stream but the only schema i can think of would be

{ streamTitle: string isLive: bool }

Leeoku commented 3 years ago

I think that's good. Only thing I can think of to add is framerate, but for a mobile setup, things can greatly fluctuate. I think streamers will care more about having an active line, so can leave out for now.

What about loss? Like packet loss? Or would user care about ping to see if they're throttled?

The only thing I can think of to improve is to consolidate the modems into an array of strings. That way we don't hardcode the modems, we just throw them in and can access them as needed

KeN095 commented 3 years ago

It seems kind of tricky but having ping might be better to show latency but having packet loss for the line chart would be relevant when plotting bitrate data. For now we can leave both packetLoss and ping in.

chungwwei commented 3 years ago

We should also include accountId, streamId, and timestamp?

Leeoku commented 3 years ago

We should also include accountId, streamId, and timestamp?

First two are good. Do we need timestamp? We already have dates

KeN095 commented 3 years ago

Updated the schema.

We should also include accountId, streamId, and timestamp?

accountID and stream ID would help in validation on account creation

We should also include accountId, streamId, and timestamp?

First two are good. Do we need timestamp? We already have dates

I'm not sure how often data is going to be passed in, but maybe timestamp can help in plotting. Having the startDate and endDate can help with calculating duration and deciding how time should scale out for graph, but duration should be obtainable if linking with twitch is something we're able to do later on

chungwwei commented 3 years ago

startDate and endDate doesn't tell when the data point is registered thou. timestamp can do that and it can just be the x-value on the X-Axis.

with timestamp, we might be able to add this component. image

We also interested in the upstream/downstream bandwidth of each modem used.

audio_bitrate is also of interest for visualization

Leeoku commented 3 years ago

Good points @chungwwei . I agree timestamp would be useful, maybe another array of dates. I was so focused on calculating the timestamp value (like fetching current time when upload goes to 0, but completely forgot to assign it to a variable) 😓