How to subscribe to the event count? #315
Unanswered
theo-brlle
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @kean! 👋
I have a specific use case where I would like to create a SwiftUI view showing the event count (network tasks & logged messages) of the current session in real time. I saw that the PulseUI console view uses the
ManagedObjectsCountObserver
class to show the count in the toolbar, but it is only accessible atpackage
level.My idea was to subscribe to the
LoggerStore.events
publisher and get the count usingLoggerStore.messages().count
, but its performance cost worries me.According to you, what would be the best solution to avoid consuming too much memory for that kind of small feature? Do you think that counting the CoreData entities each time there is a new event would work?
Thank you! 🙏
Beta Was this translation helpful? Give feedback.
All reactions