Cycl0n3
Cycl0n3

Reputation: 697

Calculate data transfer from CloudFront per user

I am using CloudFront to stream(hls) data from s3 bucket want to calculate how many Megabytes of data per user is consuming.

Whole architecture -

When a user upload a video from mobile app it runs a lambda function which trigger the MediaConvert function and convert the video into m3u8 extension (hls). For streaming video to user we are using CloudFront though which access m3u8 files from s3 bucket. Now I want to calculate how many MB of data is transfer per user and store it in mongo DB.

PS - we know which videos belongs to which user just want to calculate how many Megabytes transfer has happen for viewing those videos.

Upvotes: 1

Views: 500

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 270039

You will need to activate CloudFront access logs to record the traffic.

You can then query the logs (eg using Amazon Athena) to calculate the traffic per file.

Upvotes: 1

Related Questions