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
caaabc19
Commit
caaabc19
authored
May 20, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'DePizzottri-develop' into topic/actor-system
parents
84de90d7
0e068207
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
libcaf_core/caf/scheduler/profiled_coordinator.hpp
libcaf_core/caf/scheduler/profiled_coordinator.hpp
+27
-4
No files found.
libcaf_core/caf/scheduler/profiled_coordinator.hpp
View file @
caaabc19
...
@@ -24,9 +24,12 @@
...
@@ -24,9 +24,12 @@
#if defined(CAF_MACOS) || defined(CAF_IOS)
#if defined(CAF_MACOS) || defined(CAF_IOS)
#include <mach/mach.h>
#include <mach/mach.h>
#else
#elif defined(CAF_WINDOWS)
#include <Windows.h>
#include <Psapi.h>
#else
#include <sys/resource.h>
#include <sys/resource.h>
#endif
// CAF_MACOS
#endif
#include <cmath>
#include <cmath>
#include <mutex>
#include <mutex>
...
@@ -65,11 +68,19 @@ public:
...
@@ -65,11 +68,19 @@ public:
static
usec
to_usec
(
const
::
time_value_t
&
tv
)
{
static
usec
to_usec
(
const
::
time_value_t
&
tv
)
{
return
std
::
chrono
::
seconds
(
tv
.
seconds
)
+
usec
(
tv
.
microseconds
);
return
std
::
chrono
::
seconds
(
tv
.
seconds
)
+
usec
(
tv
.
microseconds
);
}
}
# elif defined(CAF_WINDOWS)
static
usec
to_usec
(
FILETIME
const
&
ft
)
{
ULARGE_INTEGER
time
;
time
.
LowPart
=
ft
.
dwLowDateTime
;
time
.
HighPart
=
ft
.
dwHighDateTime
;
return
std
::
chrono
::
seconds
(
time
.
QuadPart
/
10000000
)
+
usec
((
time
.
QuadPart
%
10000000
)
/
10
);
}
# else
# else
static
usec
to_usec
(
const
::
timeval
&
tv
)
{
static
usec
to_usec
(
const
::
timeval
&
tv
)
{
return
std
::
chrono
::
seconds
(
tv
.
tv_sec
)
+
usec
(
tv
.
tv_usec
);
return
std
::
chrono
::
seconds
(
tv
.
tv_sec
)
+
usec
(
tv
.
tv_usec
);
}
}
# endif
// CAF_MACOS
# endif
static
measurement
take
()
{
static
measurement
take
()
{
auto
now
=
clock_type
::
now
().
time_since_epoch
();
auto
now
=
clock_type
::
now
().
time_since_epoch
();
...
@@ -87,13 +98,25 @@ public:
...
@@ -87,13 +98,25 @@ public:
m
.
sys
=
to_usec
(
info
.
system_time
);
m
.
sys
=
to_usec
(
info
.
system_time
);
}
}
::
mach_port_deallocate
(
mach_task_self
(),
tself
);
::
mach_port_deallocate
(
mach_task_self
(),
tself
);
# elif defined(CAF_WINDOWS)
FILETIME
creation_time
,
exit_time
,
kernel_time
,
user_time
;
PROCESS_MEMORY_COUNTERS
pmc
;
GetProcessTimes
(
GetCurrentProcess
(),
&
creation_time
,
&
exit_time
,
&
kernel_time
,
&
user_time
));
GetProcessMemoryInfo
(
GetCurrentProcess
(),
&
pmc
,
sizeof
(
pmc
));
m
.
mem
=
pmc
.
PeakWorkingSetSize
/
1024
;
m
.
usr
=
to_usec
(
user_time
);
m
.
sys
=
to_usec
(
kernel_time
);
# else
# else
::
rusage
ru
;
::
rusage
ru
;
::
getrusage
(
RUSAGE_THREAD
,
&
ru
);
::
getrusage
(
RUSAGE_THREAD
,
&
ru
);
m
.
usr
=
to_usec
(
ru
.
ru_utime
);
m
.
usr
=
to_usec
(
ru
.
ru_utime
);
m
.
sys
=
to_usec
(
ru
.
ru_stime
);
m
.
sys
=
to_usec
(
ru
.
ru_stime
);
m
.
mem
=
ru
.
ru_maxrss
;
m
.
mem
=
ru
.
ru_maxrss
;
# endif
// CAF_MACOS
# endif
return
m
;
return
m
;
}
}
...
...
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