Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
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
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
Esteban Blanc
proview
Commits
0a6a853d
Commit
0a6a853d
authored
Feb 08, 2018
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sev_server time_FloatToD fix
parent
63824ffe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
sev/exe/sev_server/src/sev_server.cpp
sev/exe/sev_server/src/sev_server.cpp
+13
-7
No files found.
sev/exe/sev_server/src/sev_server.cpp
View file @
0a6a853d
...
...
@@ -499,6 +499,7 @@ int sev_server::mainloop()
pwr_tDeltaTime
busy
=
pwr_cNDeltaTime
;
pwr_tDeltaTime
idle
=
pwr_cNDeltaTime
;
pwr_tDeltaTime
dt
;
float
fbusy
,
fidle
;
float
a
=
exp
(
-
((
float
)
sev_cStatInterval
)
/
300
);
qid
.
nid
=
0
;
...
...
@@ -517,21 +518,23 @@ int sev_server::mainloop()
time_GetTime
(
&
before_get
);
time_Adiff
(
&
dt
,
&
before_get
,
&
currenttime
);
time_Dadd
(
&
busy
,
&
busy
,
&
dt
);
time_DToFloat
(
&
fbusy
,
&
busy
);
mp
=
qcom_Get
(
&
sts
,
&
qid
,
&
get
,
tmo
);
time_GetTime
(
&
currenttime
);
time_Adiff
(
&
dt
,
&
currenttime
,
&
before_get
);
time_Dadd
(
&
idle
,
&
idle
,
&
dt
);
time_DToFloat
(
&
fidle
,
&
idle
);
if
(
time_Acomp
(
&
currenttime
,
&
next_stat
)
==
1
)
{
m_stat
.
current_load
=
100.0
*
time_DToFloat
(
0
,
&
busy
)
/
(
time_DToFloat
(
0
,
&
busy
)
+
time_DToFloat
(
0
,
&
idle
)
);
m_stat
.
current_load
=
100.0
*
fbusy
/
(
fbusy
+
fidle
);
if
(
m_stat
.
medium_load
==
0
)
m_stat
.
medium_load
=
m_stat
.
current_load
;
else
m_stat
.
medium_load
=
a
*
m_stat
.
medium_load
+
(
1.0
-
a
)
*
m_stat
.
current_load
;
m_stat
.
storage_rate
=
(
float
)
m_storage_cnt
/
(
time_DToFloat
(
0
,
&
busy
)
+
time_DToFloat
(
0
,
&
idle
)
);
m_stat
.
write_rate
=
(
float
)
m_write_cnt
/
(
time_DToFloat
(
0
,
&
busy
)
+
time_DToFloat
(
0
,
&
idle
)
);
m_stat
.
storage_rate
=
(
float
)
m_storage_cnt
/
(
fbusy
+
fidle
);
m_stat
.
write_rate
=
(
float
)
m_write_cnt
/
(
fbusy
+
fidle
);
if
(
m_stat
.
medium_storage_rate
==
0
)
m_stat
.
medium_storage_rate
=
m_stat
.
storage_rate
;
else
...
...
@@ -1383,6 +1386,7 @@ void *sev_server::receive_histdata_thread( void *arg)
pwr_tDeltaTime
busy
=
pwr_cNDeltaTime
;
pwr_tDeltaTime
idle
=
pwr_cNDeltaTime
;
pwr_tDeltaTime
dt
;
float
fbusy
,
fidle
;
float
a
=
exp
(
-
((
float
)
sev_cStatInterval
)
/
300
);
pwr_sClass_SevServerThread
*
thread_conf
=
0
;
float
current_load
;
...
...
@@ -1404,6 +1408,7 @@ void *sev_server::receive_histdata_thread( void *arg)
time_GetTime
(
&
before_get
);
time_Adiff
(
&
dt
,
&
before_get
,
&
currenttime
);
time_Dadd
(
&
busy
,
&
busy
,
&
dt
);
time_DToFloat
(
&
fbusy
,
&
busy
);
qmsg
=
(
sev_sQMsgHeader
*
)
que_Get
(
NULL
,
&
th
->
queue
,
&
tmo
,
&
tmo_item
);
...
...
@@ -1421,21 +1426,22 @@ void *sev_server::receive_histdata_thread( void *arg)
time_GetTime
(
&
currenttime
);
time_Adiff
(
&
dt
,
&
currenttime
,
&
before_get
);
time_Dadd
(
&
idle
,
&
idle
,
&
dt
);
time_DToFloat
(
&
fidle
,
&
idle
);
if
(
th
->
conf_idx
>=
0
&&
time_Acomp
(
&
currenttime
,
&
next_stat
)
==
1
)
{
thread_conf
->
QueueAlloc
=
th
->
alloc
;
current_load
=
100.0
*
time_DToFloat
(
0
,
&
busy
)
/
(
time_DToFloat
(
0
,
&
busy
)
+
time_DToFloat
(
0
,
&
idle
)
);
current_load
=
100.0
*
fbusy
/
(
fbusy
+
fidle
);
if
(
thread_conf
->
MediumLoad
==
0
)
thread_conf
->
MediumLoad
=
current_load
;
else
thread_conf
->
MediumLoad
=
a
*
thread_conf
->
MediumLoad
+
(
1.0
-
a
)
*
current_load
;
thread_conf
->
StorageRate
=
(
float
)
storage_cnt
/
(
time_DToFloat
(
0
,
&
busy
)
+
time_DToFloat
(
0
,
&
idle
)
);
thread_conf
->
StorageRate
=
(
float
)
storage_cnt
/
(
fbusy
+
fidle
);
if
(
thread_conf
->
MediumStorageRate
==
0
)
thread_conf
->
MediumStorageRate
=
thread_conf
->
StorageRate
;
else
thread_conf
->
MediumStorageRate
=
a
*
thread_conf
->
MediumStorageRate
+
(
1.0
-
a
)
*
thread_conf
->
StorageRate
;
thread_conf
->
WriteRate
=
(
float
)
write_cnt
/
(
time_DToFloat
(
0
,
&
busy
)
+
time_DToFloat
(
0
,
&
idle
)
);
thread_conf
->
WriteRate
=
(
float
)
write_cnt
/
(
fbusy
+
fidle
);
if
(
thread_conf
->
MediumWriteRate
==
0
)
thread_conf
->
MediumWriteRate
=
thread_conf
->
WriteRate
;
else
...
...
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