File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ parameters:
66 liuggio_stats_d_client.collector.service.class : Liuggio\StatsDClientBundle\Service\StatsDCollectorService
77 liuggio_stats_d_client.collector.listener.class : Liuggio\StatsDClientBundle\Listener\StatsDCollectorListener
88 liuggio_stats_d_client.collector.dbal.class : Liuggio\StatsDClientBundle\StatsCollector\DbalStatsCollector
9+ liuggio_stats_d.sender.class : Liuggio\StatsdClient\Service\StatsdService
910
1011# monolog handler
1112 liuggio_stats_d_client.monolog_handler.class : Liuggio\StatsdClient\Monolog\Handler\StatsDHandler
@@ -29,4 +30,10 @@ services:
2930 class : %liuggio_stats_d_client.collector.service.class%
3031 arguments : [@liuggio_stats_d_client.service]
3132
33+ # simplified service
34+ liuggio_stats_d.service :
35+ class : %liuggio_stats_d.sender.class%
36+ arguments : [@liuggio_stats_d_client.service, @liuggio_stats_d_client.factory]
3237
38+ statsd :
39+ alias : liuggio_stats_d.service
Original file line number Diff line number Diff line change @@ -71,7 +71,18 @@ the `$data` is the object created by the factory
7171
7272the send method will optimise the data sent in order to speed up the connection.
7373
74+ ### Simplified StatsD service
7475
76+ Reference: ` statsd `
77+
78+ This service implements ` liuggio_stats_d_client.factory ` methods, as well as flush.
79+ It makes using service less verbose.
80+ ``` php
81+ $this->get('statsd')
82+ ->increment('log.error')
83+ ->gauge('log.rate', 25)
84+ ->flush();
85+ ```
7586
7687Working with ` Monolog `
7788-------------
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public function mockSecurityContext($return)
1414 {
1515 $ phpunit = $ this ;
1616 $ statsDFactory = $ this ->getMockBuilder ('Symfony\Component\Security\Core\SecurityContextInterface ' )
17- ->setMethods (array ('isGranted ' ))
17+ ->setMethods (array ('isGranted ' , ' getToken ' , ' setToken ' ))
1818 ->getMock ();
1919
2020 $ statsDFactory ->expects ($ this ->any ())
Original file line number Diff line number Diff line change 1717 ],
1818 "require" : {
1919 "php" : " >=5.3.2" ,
20- "liuggio/statsd-php-client" : " 1.0.* " ,
20+ "liuggio/statsd-php-client" : " > 1.0.12 " ,
2121 "symfony/framework-bundle" : " >2.0"
2222 },
2323 "require-dev" : {
You can’t perform that action at this time.
0 commit comments