Skip to content

Commit

Permalink
Merge pull request #83 from kbond/opcache-memory
Browse files Browse the repository at this point in the history
integrate OpCacheMemory check
  • Loading branch information
lsmith77 committed Feb 5, 2015
2 parents 943abc7 + 750e6c1 commit 48a5b8d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public function getConfigTreeBuilder()
->scalarNode('file')->defaultValue('%kernel.root_dir%/SymfonyRequirements.php')->end()
->end()
->end()
->arrayNode('opcache_memory')
->children()
->integerNode('warning')->defaultValue(70)->end()
->integerNode('critical')->defaultValue(90)->end()
->end()
->end()
->arrayNode('apc_memory')
->children()
->integerNode('warning')->defaultValue(70)->end()
Expand Down
18 changes: 18 additions & 0 deletions Resources/config/checks/opcache_memory.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="liip_monitor.check.opcache_memory.class">ZendDiagnostics\Check\OpCacheMemory</parameter>
</parameters>

<services>
<service id="liip_monitor.check.opcache_memory" public="false" class="%liip_monitor.check.opcache_memory.class%">
<argument>%liip_monitor.check.opcache_memory.warning%</argument>
<argument>%liip_monitor.check.opcache_memory.critical%</argument>
<tag name="liip_monitor.check" alias="opcache_memory" />
</service>
</services>
</container>
1 change: 1 addition & 0 deletions Tests/DependencyInjection/LiipMonitorExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public function checkProvider()
array('cpu_performance', 0.5, 'ZendDiagnostics\Check\CpuPerformance'),
array('disk_usage', array('path' => __DIR__), 'ZendDiagnostics\Check\DiskUsage'),
array('symfony_requirements', array('file' => __DIR__.'/../../LiipMonitorBundle.php'), 'Liip\MonitorBundle\Check\SymfonyRequirements'),
array('opcache_memory', null, 'ZendDiagnostics\Check\OpCacheMemory'),
array('apc_memory', null, 'ZendDiagnostics\Check\ApcMemory'),
array('apc_fragmentation', null, 'ZendDiagnostics\Check\ApcFragmentation'),
array('doctrine_dbal', 'foo', 'Liip\MonitorBundle\Check\DoctrineDbal', 'doctrine_dbal_foo_connection'),
Expand Down

0 comments on commit 48a5b8d

Please sign in to comment.