Commit 87e1e72c authored by Korko's avatar Korko
Browse files

Put Statsd conf in env and add new stat about how many sms sent exactly

parent df106047
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Korko\SecretSanta\Http\Controllers; namespace Korko\SecretSanta\Http\Controllers;
use Facades\Korko\SecretSanta\Libs\HatSolver as Solver; use Facades\Korko\SecretSanta\Libs\HatSolver as Solver;
use Facades\Korko\SecretSanta\Libs\SmsTools as SmsTools;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Korko\SecretSanta\Draw; use Korko\SecretSanta\Draw;
use Korko\SecretSanta\Exceptions\SolverException; use Korko\SecretSanta\Exceptions\SolverException;
...@@ -94,6 +95,7 @@ class RandomFormController extends Controller ...@@ -94,6 +95,7 @@ class RandomFormController extends Controller
if (!empty($santa['phone'])) { if (!empty($santa['phone'])) {
Statsd::increment('phone'); Statsd::increment('phone');
Statsd::increment('sms', SmsTools::count($request->input('contentSMS')));
$this->sendSms($santa, $target, $request->input('contentSMS')); $this->sendSms($santa, $target, $request->input('contentSMS'));
} }
} }
......
<?php <?php
return [ return [
'host' => '127.0.0.1', 'host' => env('STATSD_HOST'),
'port' => 8125, 'port' => env('STATSD_PORT'),
'namespace' => 'secretsanta', 'namespace' => env('STATSD_NAMESPACE', 'secretsanta'),
]; ];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment