Skip to content

Commit

Permalink
Fixes for DB Status metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
turbo124 committed Sep 8, 2022
1 parent 76475c4 commit e36ffac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Jobs/Database/MySQL/DbStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ class DbStatus implements ShouldQueue
* @return void
*/

private $connection;
private $db_connection;

private $name;

private $force_send;

public function __construct(string $connection, string $name, bool $force_send = false)
public function __construct(string $db_connection, string $name, bool $force_send = false)
{
$this->connection = $connection;
$this->db_connection = $db_connection;

$this->name = $name;

Expand All @@ -49,7 +49,7 @@ public function __construct(string $connection, string $name, bool $force_send =
public function handle()
{

config(['database.default' => $this->connection]);
config(['database.default' => $this->db_connection]);

$db_status = $this->checkDbConnection();

Expand All @@ -72,7 +72,7 @@ public function handle()
{

$metric = new GenericMixedMetric();
$metric->name = 'database.slave_status.'.$this->connection;
$metric->name = 'database.slave_status.'.$this->db_connection;
$metric->string_metric5 = $variables->Master_Host;
$metric->string_metric6 = $variables->Slave_IO_Running;
$metric->string_metric7 = $variables->Slave_SQL_Running;
Expand All @@ -89,7 +89,7 @@ public function handle()
if($status_variables)
{
$metric = new GenericMultiMetric();
$metric->name = 'database.performance.'.$this->connection;
$metric->name = 'database.performance.'.$this->db_connection;
$metric->metric1 = $status_variables->Innodb_data_read;
$metric->metric2 = $status_variables->Innodb_data_writes;
$metric->metric3 = $status_variables->Max_used_connections;
Expand Down

0 comments on commit e36ffac

Please sign in to comment.