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
923f267c
Commit
923f267c
authored
3 years ago
by
Aastha Mehta
Browse files
Options
Downloads
Patches
Plain Diff
commit pending changes
parent
7648d1ad
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sme_extn/sme_helper.php
+34
-6
34 additions, 6 deletions
sme_extn/sme_helper.php
with
34 additions
and
6 deletions
sme_extn/sme_helper.php
+
34
−
6
View file @
923f267c
...
...
@@ -477,6 +477,23 @@ function filesize_binning_wiktionary($file_size)
return
"extra-large"
;
}
function
filesize_binning_wiktionary_unzipped
(
$file_size
)
{
/*
* #frames in profiles: S - 21, M - 21, L - 64, XL - 3879 --> 4363
*/
# if (intval($file_size) <= 14600)
# return "small";
if
(
intval
(
$file_size
)
<=
24820
)
return
"medium"
;
if
(
intval
(
$file_size
)
<=
81760
)
return
"large"
;
return
"extra-large"
;
}
function
filesize_binning_medical_wiktionary
(
$file_size
)
{
/*
...
...
@@ -499,7 +516,7 @@ function filesize_binning_medical_wiktionary($file_size)
return
"large"
;
if
((
intval
(
$file_size
)
>
12000
&&
intval
(
$file_size
)
<=
49348
)
||
(
intval
(
$file_size
)
>
85432
&&
intval
(
$file_size
)
<=
600000
))
||
(
intval
(
$file_size
)
>
85432
))
return
"extra-large"
;
}
...
...
@@ -546,13 +563,24 @@ function set_request_id($pubinput, $privinput)
#print_r($privinput);
for
(
$i
=
0
;
$i
<
$num_pub
;
$i
++
)
{
$cluster_name
=
$cpu_load
.
$pubinput
[
$i
];
$pubinput
[
$i
]
=
$cpu_load
.
$pubinput
[
$i
];
$cluster_name
=
$cpu_load
.
$pubinput
[
$i
];
$pubinput
[
$i
]
=
$cpu_load
.
$pubinput
[
$i
];
if
(
isset
(
$wgSMEPrivBinning
)
&&
$wgSMEPrivBinning
==
1
)
{
$hash
=
md5
(
$privinput
[
$i
]);
$file_size
=
filesize
(
$wgFileCacheDirectory
.
'/'
.
substr
(
$hash
,
0
,
1
)
.
'/'
.
substr
(
$hash
,
0
,
2
)
.
'/'
.
urlencode
(
$privinput
[
$i
])
.
'.html.gz'
);
$cluster_suff
=
filesize_binning_medical_wiktionary
(
intval
(
$file_size
));
$hash
=
md5
(
$privinput
[
$i
]);
if
(
str_contains
(
$wgFileCacheDirectory
,
"padded"
)
==
True
)
{
$sz_fpath
=
$wgFileCacheDirectory
;
$sz_fpath
.
=
'/'
.
substr
(
$hash
,
0
,
1
)
.
'/'
.
substr
(
$hash
,
0
,
2
);
$sz_fpath
.
=
'/'
.
urlencode
(
$privinput
[
$i
])
.
'.html'
;
$file_size
=
filesize
(
$sz_fpath
);
}
else
{
$sz_fpath
=
$wgFileCacheDirectory
;
$sz_fpath
.
=
'/'
.
substr
(
$hash
,
0
,
1
)
.
'/'
.
substr
(
$hash
,
0
,
2
);
$sz_fpath
.
=
'/'
.
urlencode
(
$privinput
[
$i
])
.
'.html.gz'
;
$file_size
=
filesize
(
$sz_fpath
);
}
$cluster_suff
=
filesize_binning_wiktionary
(
intval
(
$file_size
));
# $cluster_suff = filesize_binning_wiktionary_unzipped(intval($file_size));
$cluster_name
=
$cluster_name
.
$cluster_suff
;
$public_input_hash
[]
=
md5
(
$cluster_name
,
True
);
}
else
{
...
...
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