bifravst / sim-details

Provide detailed information about SIM from known partners
http://sim-details.nordicsemi.cloud
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Provide data usage per timeSpan in details #107

Open coderbyheart opened 1 month ago

coderbyheart commented 1 month ago

Now that we have history, we can also share the usage per timeSpan in the sim details response.

That means that for each of these time spans, return the sum of bytes used.

Property Sum of bytes used
lastHour in the last hour.
lastDay in the last 24 hours.
lastWeek in the last 7 days.
lastMonth in the last 30 days.
Lenakh97 commented 1 month ago

Could it make sense to return the sum from 'lastHour','lastDay','lastWeek' and 'lastMonth' and in addition return hourly,daily and weekly averages which is calculated from the data from the last month/as much data as we have. As an example this could be:

dataUsagePerTimespan: { lastHour: 10060, lastDay: 211527, lastWeek: 1395739, lastMonth: 2691339, } averageDataUsage: { hourly: 6727, daily: 161468, weekly: 1130282 }

Where the first one is the usage summed up for each timespan and for the average I'm using all the data I can get from the last month and find the average from the first day I can find any data usage. (Ex if someone started to use the device only 2 weeks ago the average is calculated from the last two weeks instead of from the entire last month.) Or are you only interested in the last one with the average usage?

coderbyheart commented 1 month ago

Yes, sounds good!

coderbyheart commented 1 month ago

To clarify, the response should return usage per time last time span. The initial description was misleading. Updated the description above.