Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mediawiki-1.27.1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pacer
mediawiki-1.27.1
Commits
05b9a5ed
Commit
05b9a5ed
authored
7 years ago
by
Mohamed Alzayat
Browse files
Options
Downloads
Patches
Plain Diff
Logging statistics on marker sync and 5-tuple fetching
parent
dbbf91d1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LocalSettings.php
+1
-0
1 addition, 0 deletions
LocalSettings.php
sme_extn/sme_helper.php
+35
-6
35 additions, 6 deletions
sme_extn/sme_helper.php
with
36 additions
and
6 deletions
LocalSettings.php
+
1
−
0
View file @
05b9a5ed
...
@@ -163,6 +163,7 @@ $wgInvalidateCacheOnLocalSettingsChange=0;
...
@@ -163,6 +163,7 @@ $wgInvalidateCacheOnLocalSettingsChange=0;
##added by alzayat -- 28/03/2017
##added by alzayat -- 28/03/2017
$wgSMEEnabled
=
1
;
$wgSMEEnabled
=
1
;
$wgSMEStats
=
1
;
$wgSMEProfiling
=
0
;
$wgSMEProfiling
=
0
;
$wgSMEEnforcement
=
1
;
$wgSMEEnforcement
=
1
;
$wgSMEDebug
=
0
;
$wgSMEDebug
=
0
;
...
...
This diff is collapsed.
Click to expand it.
sme_extn/sme_helper.php
+
35
−
6
View file @
05b9a5ed
...
@@ -696,6 +696,7 @@ function sendBackendProfileToKernel($pubhash, $privhash, $mysqli)
...
@@ -696,6 +696,7 @@ function sendBackendProfileToKernel($pubhash, $privhash, $mysqli)
global
$wgSMEDebug
;
global
$wgSMEDebug
;
global
$wgSMEDummyIP
,
$wgSMEDummyPort
;
global
$wgSMEDummyIP
,
$wgSMEDummyPort
;
global
$SME_KERNEL_ENFORCEMENT_TIMESTAMP
;
global
$SME_KERNEL_ENFORCEMENT_TIMESTAMP
;
global
$wgSMEStats
;
if
(
isset
(
$wgSMEDummyIP
))
if
(
isset
(
$wgSMEDummyIP
))
$dummy_server_ip
=
$wgSMEDummyIP
;
$dummy_server_ip
=
$wgSMEDummyIP
;
...
@@ -709,9 +710,23 @@ function sendBackendProfileToKernel($pubhash, $privhash, $mysqli)
...
@@ -709,9 +710,23 @@ function sendBackendProfileToKernel($pubhash, $privhash, $mysqli)
get_local_ip_port
(
$server_ip
,
$server_port
);
get_local_ip_port
(
$server_ip
,
$server_port
);
get_remote_ip_port
(
$client_ip
,
$client_port
);
get_remote_ip_port
(
$client_ip
,
$client_port
);
if
(
isset
(
$wgSMEStats
)
&&
$wgSMEStats
){
$time_start
=
microtime
(
true
);
}
identify_backend_connection
(
$local_backend_ip
,
$local_backend_port
,
identify_backend_connection
(
$local_backend_ip
,
$local_backend_port
,
$remote_backend_ip
,
$remote_backend_port
);
$remote_backend_ip
,
$remote_backend_port
);
if
(
isset
(
$wgSMEStats
)
&&
$wgSMEStats
){
$time_end
=
microtime
(
true
);
$time
=
$time_end
-
$time_start
;
file_put_contents
(
"/local/sme/stats_5_tuple.txt"
,
"Time required for fetching the 5 tuple is:
$time
(seconds)
\n
"
,
LOCK_EX
|
FILE_APPEND
);
}
/*
/*
file_put_contents("/local/sme/besock.txt",
file_put_contents("/local/sme/besock.txt",
"src: $client_ip $client_port, in: $server_ip $server_port" .
"src: $client_ip $client_port, in: $server_ip $server_port" .
...
@@ -720,11 +735,6 @@ function sendBackendProfileToKernel($pubhash, $privhash, $mysqli)
...
@@ -720,11 +735,6 @@ function sendBackendProfileToKernel($pubhash, $privhash, $mysqli)
*/
*/
// Wait for ACK to the FE-Client marker on the frontend kernel,
// before sending the FE-BE marker
if
(
isset
(
$wgSMEDebug
)
&&
$wgSMEDebug
==
0
)
{
waitForKernelACK
(
$SME_MARKER_SOCK
,
$dummy_server_ip
,
$dummy_server_port
);
}
$num_pub
=
count
(
$pubhash
);
$num_pub
=
count
(
$pubhash
);
$num_priv
=
count
(
$privhash
);
$num_priv
=
count
(
$privhash
);
...
@@ -739,6 +749,12 @@ function sendBackendProfileToKernel($pubhash, $privhash, $mysqli)
...
@@ -739,6 +749,12 @@ function sendBackendProfileToKernel($pubhash, $privhash, $mysqli)
/*
/*
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
*/
*/
// Wait for ACK to the FE-Client marker on the frontend kernel,
// before sending the FE-BE marker
if
(
isset
(
$wgSMEDebug
)
&&
$wgSMEDebug
==
0
)
{
waitForKernelACK
(
$SME_MARKER_SOCK
,
$dummy_server_ip
,
$dummy_server_port
);
}
// Send FE-BE profile marker to kernel
// Send FE-BE profile marker to kernel
$ret
=
socket_sendto
(
$SME_MARKER_SOCK
,
$pbuf_FE_BE
,
$plen_FE_BE
,
0
,
$ret
=
socket_sendto
(
$SME_MARKER_SOCK
,
$pbuf_FE_BE
,
$plen_FE_BE
,
0
,
...
@@ -771,15 +787,28 @@ function sendBackendProfileToKernel($pubhash, $privhash, $mysqli)
...
@@ -771,15 +787,28 @@ function sendBackendProfileToKernel($pubhash, $privhash, $mysqli)
function
waitForKernelACK
(
$sock
,
$dummy_server_ip
,
$dummy_server_port
){
function
waitForKernelACK
(
$sock
,
$dummy_server_ip
,
$dummy_server_port
){
global
$SME_KERNEL_ENFORCEMENT_TIMESTAMP
;
global
$SME_KERNEL_ENFORCEMENT_TIMESTAMP
;
global
$wgSMEDebug
;
global
$wgSMEDebug
;
global
$wgSMEStats
;
if
(
$sock
==
-
1
)
{
if
(
$sock
==
-
1
)
{
file_put_contents
(
"/local/sme/msg_sent_to_kernel.txt"
,
"sock:
$sock
\n
"
,
file_put_contents
(
"/local/sme/msg_sent_to_kernel.txt"
,
"sock:
$sock
\n
"
,
FILE_APPEND
|
LOCK_EX
);
FILE_APPEND
|
LOCK_EX
);
return
;
return
;
}
}
if
(
isset
(
$wgSMEStats
)
&&
$wgSMEStats
){
$time_start
=
microtime
(
true
);
}
$ret
=
socket_recvfrom
(
$sock
,
$ackbuf
,
8
,
0
,
$ret
=
socket_recvfrom
(
$sock
,
$ackbuf
,
8
,
0
,
$dummy_server_ip
,
$dummy_server_port
);
$dummy_server_ip
,
$dummy_server_port
);
if
(
isset
(
$wgSMEStats
)
&&
$wgSMEStats
){
$time_end
=
microtime
(
true
);
$time
=
$time_end
-
$time_start
;
file_put_contents
(
"/local/sme/stats_marker_sync.txt"
,
"Marker sync additional delay:
$time
\n
"
,
LOCK_EX
|
FILE_APPEND
);
}
$SME_KERNEL_ENFORCEMENT_TIMESTAMP
=
int_helper
::
uInt64
(
$ackbuf
);
$SME_KERNEL_ENFORCEMENT_TIMESTAMP
=
int_helper
::
uInt64
(
$ackbuf
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment