Skip to content

Commit 0133372

Browse files
committed
Merge pull request #560 from saimaz/patch-profiler
Removed profiler option, from now on it is turned on in dev by default
2 parents c5768b2 + 46bc217 commit 0133372

File tree

5 files changed

+5
-20
lines changed

5 files changed

+5
-20
lines changed

DependencyInjection/Configuration.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,8 @@ private function getManagersNode()
177177
'The type of commit to the elasticsearch'
178178
)
179179
->end()
180-
->booleanNode('profiler')
181-
->info('Enables elasticsearch profiler in the Symfony web profiler toolbar.')
182-
->defaultFalse()
183-
->end()
184180
->arrayNode('logger')
185-
->info('Enables logging')
181+
->info('Enables elasticsearch queries logging')
186182
->addDefaultsIfNotSet()
187183
->beforeNormalization()
188184
->ifTrue(
@@ -202,15 +198,15 @@ function ($v) {
202198
->defaultFalse()
203199
->end()
204200
->scalarNode('level')
205-
->info('Sets psr logging level')
201+
->info('Sets PSR logging level')
206202
->defaultValue(LogLevel::WARNING)
207203
->validate()
208204
->ifNotInArray((new \ReflectionClass('Psr\Log\LogLevel'))->getConstants())
209-
->thenInvalid('Invalid Psr log level.')
205+
->thenInvalid('Invalid PSR log level.')
210206
->end()
211207
->end()
212208
->scalarNode('log_file_name')
213-
->info('Log filename, by default it is manager name')
209+
->info('Log filename, by default it is a manager name')
214210
->defaultValue(null)
215211
->end()
216212
->end()

Resources/doc/configuration.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ ongr_elasticsearch:
4646
managers:
4747
default:
4848
connection: default
49-
profiler: true #default %kernel.debug%
5049
logger: true #default %kernel.debug%
5150
readonly: false #default false
5251
mappings:
@@ -55,7 +54,6 @@ ongr_elasticsearch:
5554
connection: bar
5655
readonly:
5756
connection: default
58-
profiler: true
5957
readonly: true
6058
mappings:
6159
- AcmeBarBundle:UserDocument #Includes only one type to the mapping

Service/ManagerFactory.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,8 @@ public function createManager($managerName, $connection, $analysis, $managerConf
7777
$mappings = $this->metadataCollector->getClientMapping($managerConfig['mappings']);
7878

7979
$client = ClientBuilder::create();
80-
8180
$client->setHosts($connection['hosts']);
82-
83-
if ($this->tracer && $managerConfig['profiler']) {
84-
$client->setTracer($this->tracer);
85-
}
81+
$client->setTracer($this->tracer);
8682

8783
if ($this->logger && $managerConfig['logger']['enabled']) {
8884
$client->setLogger($this->logger);

Tests/Unit/DependencyInjection/ElasticsearchExtensionTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public function getData()
6464
$expectedManagers = [
6565
'test' => [
6666
'connection' => 'test2',
67-
'profiler' => false,
6867
'logger' => [
6968
'enabled' => true,
7069
'level' => 'warning',
@@ -91,7 +90,6 @@ public function getData()
9190
'managers' => [
9291
'test' => [
9392
'connection' => 'test2',
94-
'profiler' => true,
9593
'logger' => true,
9694
'readonly' => false,
9795
'mappings' => ['testBundle'],
@@ -103,7 +101,6 @@ public function getData()
103101
$expectedManagers = [
104102
'test' => [
105103
'connection' => 'test2',
106-
'profiler' => true,
107104
'logger' => [
108105
'enabled' => true,
109106
'level' => 'warning',

Tests/app/config/config_test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ ongr_elasticsearch:
2222
managers:
2323
default:
2424
connection: default
25-
profiler: true
2625
logger: true
2726
mappings:
2827
- AcmeBarBundle
@@ -33,7 +32,6 @@ ongr_elasticsearch:
3332
- AcmeFooBundle
3433
readonly:
3534
connection: default
36-
profiler: true
3735
readonly: true
3836
mappings:
3937
- AcmeBarBundle

0 commit comments

Comments
 (0)