diff --git a/src/Events/DefaultEventFactory.php b/src/Events/DefaultEventFactory.php index 811aa3f..b7ca7b7 100644 --- a/src/Events/DefaultEventFactory.php +++ b/src/Events/DefaultEventFactory.php @@ -31,7 +31,7 @@ public function newSpan(string $name, EventBean $parent): Span /** * {@inheritdoc} */ - public function newMetricset($set, $tags): Metricset + public function newMetricset(array $set, array $tags = []): Metricset { return new Metricset($set, $tags); } diff --git a/src/Events/EventFactoryInterface.php b/src/Events/EventFactoryInterface.php index d7db1cd..068f488 100644 --- a/src/Events/EventFactoryInterface.php +++ b/src/Events/EventFactoryInterface.php @@ -45,6 +45,6 @@ public function newSpan(string $name, EventBean $parent): Span; * * @return Metricset */ - public function newMetricset($set, $tags): Metricset; + public function newMetricset(array $set, array $tags = []): Metricset; } diff --git a/src/Events/Metricset.php b/src/Events/Metricset.php index f64edf2..c839990 100644 --- a/src/Events/Metricset.php +++ b/src/Events/Metricset.php @@ -26,7 +26,7 @@ class Metricset extends EventBean implements \JsonSerializable * @param array $set * @param array $tags */ - public function __construct(array $set, array $tags) + public function __construct(array $set, array $tags = []) { parent::__construct([]); foreach($set as $k => $v) { @@ -47,6 +47,7 @@ public function jsonSerialize() : array return [ 'metricset' => [ 'samples' => $this->samples, +// 'tags' => $this->tags, 'timestamp' => $this->getTimestamp(), ] ];