Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
f4a62a2f
Commit
f4a62a2f
authored
Jul 13, 2010
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
немного переписал код для ведения статистики обмена
parent
606ceab8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
MBTCPMaster.cc
extensions/MBTCPMaster/MBTCPMaster.cc
+13
-14
MBTCPMaster.h
extensions/MBTCPMaster/MBTCPMaster.h
+2
-2
No files found.
extensions/MBTCPMaster/MBTCPMaster.cc
View file @
f4a62a2f
...
@@ -23,7 +23,8 @@ noQueryOptimization(false),
...
@@ -23,7 +23,8 @@ noQueryOptimization(false),
force_disconnect
(
false
),
force_disconnect
(
false
),
allNotRespond
(
false
),
allNotRespond
(
false
),
prefix
(
prefix
),
prefix
(
prefix
),
no_extimer
(
false
)
no_extimer
(
false
),
poll_count
(
0
)
{
{
// cout << "$ $" << endl;
// cout << "$ $" << endl;
...
@@ -47,9 +48,9 @@ no_extimer(false)
...
@@ -47,9 +48,9 @@ no_extimer(false)
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): read fileter-field='"
<<
s_field
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): read fileter-field='"
<<
s_field
<<
"' filter-value='"
<<
s_fvalue
<<
"'"
<<
endl
;
<<
"' filter-value='"
<<
s_fvalue
<<
"'"
<<
endl
;
//задаем тестовое время (если нет, то оно равно 0)
stat_time
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-statistic-sec"
,
it
.
getProp
(
"statistic_sec"
),
0
);
test_time
=
0
;
if
(
stat_time
>
0
)
test_time
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-statistic-sec"
);
ptStatistic
.
setTiming
(
stat_time
*
1000
);
// ---------- init MBTCP ----------
// ---------- init MBTCP ----------
string
pname
(
"--"
+
prefix
+
"-gateway-iaddr"
);
string
pname
(
"--"
+
prefix
+
"-gateway-iaddr"
);
...
@@ -306,17 +307,15 @@ void MBTCPMaster::poll()
...
@@ -306,17 +307,15 @@ void MBTCPMaster::poll()
break
;
break
;
}
}
if
(
test_time
==
0
)
if
(
stat_time
>
0
)
continue
;
poll_count
++
;
if
(
poll_count
==
0
)
pt
=
PassiveTimer
();
if
(
pt
.
getCurrent
()
>=
test_time
*
1000
)
{
{
cout
<<
endl
<<
"numbr of calls is "
<<
poll_count
<<
endl
<<
endl
;
poll_count
++
;
pt
.
reset
();
if
(
ptStatistic
.
checkTime
()
)
poll_count
=
0
;
{
cout
<<
endl
<<
"(poll statistic): number of calls is "
<<
poll_count
<<
" (poll time: "
<<
stat_time
<<
" sec)"
<<
endl
<<
endl
;
ptStatistic
.
reset
();
poll_count
=
0
;
}
}
}
// mb->disconnect();
// mb->disconnect();
...
...
extensions/MBTCPMaster/MBTCPMaster.h
View file @
f4a62a2f
...
@@ -378,9 +378,9 @@ class MBTCPMaster:
...
@@ -378,9 +378,9 @@ class MBTCPMaster:
bool
no_extimer
;
bool
no_extimer
;
timeout_t
test_time
;
/*! При тестировании это время, за которое мы веведем в консоль кол-во посланных запросов MBTCPMaster-ом
*/
timeout_t
stat_time
;
/*!< время сбора статистики обмена
*/
int
poll_count
;
int
poll_count
;
PassiveTimer
pt
;
PassiveTimer
pt
Statistic
;
/*!< таймер для сбора статистики обмена */
};
};
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
#endif // _MBTCPMaster_H_
#endif // _MBTCPMaster_H_
...
...
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