Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
2aad39d0
Commit
2aad39d0
authored
Jan 09, 2019
by
Dominik Charousset
Committed by
Dominik Charousset
Jan 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new log component for streaming-related events
parent
b93be04a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
libcaf_core/caf/logger.hpp
libcaf_core/caf/logger.hpp
+17
-0
libcaf_core/src/inbound_path.cpp
libcaf_core/src/inbound_path.cpp
+8
-0
No files found.
libcaf_core/caf/logger.hpp
View file @
2aad39d0
...
...
@@ -613,3 +613,20 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
"TERMINATE ; ID =" << thisptr->id() \
<< "; REASON =" << deep_to_string(rsn).c_str() \
<< "; NODE =" << thisptr->node())
// -- macros for logging streaming-related events ------------------------------
/// The log component for logging streaming-related events that are crucial for
/// understanding handshaking, credit decisions, etc.
#define CAF_LOG_STREAM_COMPONENT "caf_stream"
#if CAF_LOG_LEVEL >= CAF_LOG_LEVEL_DEBUG
#define CAF_STREAM_LOG_DEBUG(output) \
CAF_LOG_IMPL(CAF_LOG_STREAM_COMPONENT, CAF_LOG_LEVEL_DEBUG, output)
#define CAF_STREAM_LOG_DEBUG_IF(condition, output) \
if (condition) \
CAF_LOG_IMPL(CAF_LOG_STREAM_COMPONENT, CAF_LOG_LEVEL_DEBUG, output)
#else
#define CAF_STREAM_LOG_DEBUG(unused) CAF_VOID_STMT
#define CAF_STREAM_LOG_DEBUG_IF(unused1, unused2) CAF_VOID_STMT
#endif
libcaf_core/src/inbound_path.cpp
View file @
2aad39d0
...
...
@@ -88,10 +88,18 @@ void inbound_path::handle(downstream_msg::batch& x) {
auto
batch_size
=
x
.
xs_size
;
last_batch_id
=
x
.
id
;
auto
t0
=
clk
.
now
();
CAF_STREAM_LOG_DEBUG
(
"handle batch of size"
<<
batch_size
<<
"on slot"
<<
slots
.
receiver
<<
"with"
<<
assigned_credit
<<
"assigned credit"
);
if
(
assigned_credit
<=
batch_size
)
{
assigned_credit
=
0
;
// Do not log a message when "running out of credit" for the first batch
// that can easily consume the initial credit in one shot.
CAF_STREAM_LOG_DEBUG_IF
(
next_credit_decision
.
time_since_epoch
().
count
()
>
0
,
"source at slot"
<<
slots
.
receiver
<<
"ran out of credit with approx."
<<
(
next_credit_decision
-
t0
)
<<
"until next cycle"
);
}
else
{
assigned_credit
-=
batch_size
;
CAF_ASSERT
(
assigned_credit
>=
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment