From 1cf91077eed09cb06dafe2fd94405a583d185aae Mon Sep 17 00:00:00 2001 From: Jan Brauer Date: Wed, 21 Sep 2016 15:34:34 +0200 Subject: [PATCH] Rename host to address --- src/Prometheus/PushGateway.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Prometheus/PushGateway.php b/src/Prometheus/PushGateway.php index f96f882..6fb6a01 100644 --- a/src/Prometheus/PushGateway.php +++ b/src/Prometheus/PushGateway.php @@ -8,15 +8,15 @@ class PushGateway { - private $host; + private $address; /** * PushGateway constructor. - * @param $host string host name of the push gateway + * @param $address string host:port of the push gateway */ - public function __construct($host) + public function __construct($address) { - $this->host = $host; + $this->address = $address; } /** @@ -27,7 +27,7 @@ public function __construct($host) */ public function push(CollectorRegistry $collectorRegistry, $job, $groupingKey = null) { - $url = "http://" . $this->host . "/metrics/job/" . $job; + $url = "http://" . $this->address . "/metrics/job/" . $job; if (!empty($groupingKey)) { foreach ($groupingKey as $label => $value) { $url .= "/" . $label . "/" . $value; @@ -46,7 +46,7 @@ public function push(CollectorRegistry $collectorRegistry, $job, $groupingKey = )); $statusCode = $response->getStatusCode(); if ($statusCode != 202) { - $msg = "Unexpected status code " . $statusCode . " received from pushgateway " . $this->host . ": " . $response->getBody(); + $msg = "Unexpected status code " . $statusCode . " received from pushgateway " . $this->address . ": " . $response->getBody(); throw new \RuntimeException($msg); } }