Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache: print cache for easier debugging #76

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

emranemran
Copy link
Collaborator

@emranemran emranemran commented Oct 20, 2022

It's nice to see print the cache contents when things are stored/deleted from the cache - makes debugging certain situations easier.

@codecov
Copy link

codecov bot commented Oct 20, 2022

Codecov Report

Merging #76 (86806ee) into main (dfffccd) will increase coverage by 0.49988%.
The diff coverage is 100.00000%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##                main         #76         +/-   ##
===================================================
+ Coverage   38.76543%   39.26531%   +0.49988%     
===================================================
  Files             18          18                 
  Lines           1215        1225         +10     
===================================================
+ Hits             471         481         +10     
  Misses           688         688                 
  Partials          56          56                 
Impacted Files Coverage Δ
cache/segmenting.go 77.77778% <100.00000%> (+3.58423%) ⬆️
cache/transcoding.go 60.25641% <100.00000%> (+2.72216%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfffccd...86806ee. Read the comment docs.

Impacted Files Coverage Δ
cache/segmenting.go 77.77778% <100.00000%> (+3.58423%) ⬆️
cache/transcoding.go 60.25641% <100.00000%> (+2.72216%) ⬆️

info.updatedAt = time.Now()
c.pushes[streamName] = &info
c.mutex.Unlock()
c.Print()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should definitely print information about what's happening (Storing to / removing from the cache) and I don't love this "Debug" flag. Let's just be bold and log it until we hit traffic levels where the logging volume is an issue

@emranemran
Copy link
Collaborator Author

emranemran commented Oct 20, 2022

Updates:

  • address comments
  • added pretty module for pretty printing cache tables -- I was hesitant to add yet another package but the benefits of being able to grasp info from noisy logs outweighed the negatives.
"add catalyst_vod_cdegbgfe: SegmentingCache"
{catalyst_vod_cdegbgfe: {SourceFile:            "s3+https:/REDACTED/10s.mp4",
                         CallbackURL:           "https://webhook.site/12345678",
                         UploadURL:             "s3+https:/REDACTED/10s.mp4/vod/test.m3u8",
                         AccessToken:           "1234",
                         TranscodeAPIUrl:       "https://origin.livepeer.com/api/",
--
"remove catalyst_vod_cdegbgfe: SegmentingCache"
{}

@emranemran emranemran merged commit ebe54b4 into main Oct 20, 2022
@hjpotter92 hjpotter92 deleted the emran/debug-prints-for-cache branch May 30, 2023 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants