Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Commits
84b24a24
Commit
84b24a24
authored
5 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
added more timings
parent
a6e0ab4e
No related branches found
No related tags found
3 merge requests
!1509
Development
,
!1508
Development
,
!1507
Resolve "Implement Timing output"
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Http/Controllers/MetaGerSearch.php
+2
-5
2 additions, 5 deletions
app/Http/Controllers/MetaGerSearch.php
app/MetaGer.php
+21
-1
21 additions, 1 deletion
app/MetaGer.php
with
23 additions
and
6 deletions
app/Http/Controllers/MetaGerSearch.php
+
2
−
5
View file @
84b24a24
...
...
@@ -61,14 +61,11 @@ class MetaGerSearch extends Controller
# Suche für alle zu verwendenden Suchmaschinen als Job erstellen,
# auf Ergebnisse warten und die Ergebnisse laden
$metager
->
createSearchEngines
(
$request
);
if
(
!
empty
(
$timings
))
{
$timings
[
"createSearchEngines"
]
=
microtime
(
true
)
-
$time
;
}
$metager
->
createSearchEngines
(
$request
,
$timings
);
$metager
->
startSearch
();
if
(
!
empty
(
$timings
))
{
$timings
[
"
createSearchEngines
"
]
=
microtime
(
true
)
-
$time
;
$timings
[
"
startSearch
"
]
=
microtime
(
true
)
-
$time
;
}
$metager
->
waitForMainResults
();
...
...
This diff is collapsed.
Click to expand it.
app/MetaGer.php
+
21
−
1
View file @
84b24a24
...
...
@@ -473,8 +473,12 @@ class MetaGer
* Die Erstellung der Suchmaschinen bis die Ergebnisse da sind mit Unterfunktionen
*/
public
function
createSearchEngines
(
Request
$request
)
public
function
createSearchEngines
(
Request
$request
,
&
$timings
)
{
if
(
!
empty
(
$timings
))
{
$timings
[
"createSearchEngines"
][
"start"
]
=
microtime
(
true
)
-
$timings
[
"starttime"
];
}
# Wenn es kein Suchwort gibt
if
(
!
$request
->
filled
(
"eingabe"
)
||
$this
->
q
===
""
)
{
return
;
...
...
@@ -495,8 +499,16 @@ class MetaGer
$sumas
[
$sumaName
]
=
$this
->
sumaFile
->
sumas
->
{
$sumaName
};
}
if
(
!
empty
(
$timings
))
{
$timings
[
"createSearchEngines"
][
"created engine array"
]
=
microtime
(
true
)
-
$timings
[
"starttime"
];
}
$this
->
removeAdsFromListIfAdfree
(
$sumas
);
if
(
!
empty
(
$timings
))
{
$timings
[
"createSearchEngines"
][
"removed ads"
]
=
microtime
(
true
)
-
$timings
[
"starttime"
];
}
foreach
(
$sumas
as
$sumaName
=>
$suma
)
{
# Check if this engine is disabled and can't be used
$disabled
=
empty
(
$suma
->
disabled
)
?
false
:
$suma
->
disabled
;
...
...
@@ -550,6 +562,10 @@ class MetaGer
}
}
if
(
!
empty
(
$timings
))
{
$timings
[
"createSearchEngines"
][
"filtered invalid engines"
]
=
microtime
(
true
)
-
$timings
[
"starttime"
];
}
# Include Yahoo Ads if Yahoo is not enabled as a searchengine
if
(
!
$this
->
apiAuthorized
&&
$this
->
fokus
!=
"bilder"
&&
empty
(
$this
->
enabledSearchengines
[
"yahoo"
])
&&
isset
(
$this
->
sumaFile
->
sumas
->
{
"yahoo-ads"
}))
{
$this
->
enabledSearchengines
[
"yahoo-ads"
]
=
$this
->
sumaFile
->
sumas
->
{
"yahoo-ads"
};
...
...
@@ -574,6 +590,10 @@ class MetaGer
$this
->
errors
[]
=
$error
;
}
$this
->
setEngines
(
$request
);
if
(
!
empty
(
$timings
))
{
$timings
[
"createSearchEngines"
][
"saved engines"
]
=
microtime
(
true
)
-
$timings
[
"starttime"
];
}
}
private
function
removeAdsFromListIfAdfree
(
&
$sumas
)
...
...
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