summaryrefslogtreecommitdiff
path: root/vendor/open-telemetry/sdk/Metrics/Stream/MetricStreamInterface.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/open-telemetry/sdk/Metrics/Stream/MetricStreamInterface.php')
-rw-r--r--vendor/open-telemetry/sdk/Metrics/Stream/MetricStreamInterface.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/vendor/open-telemetry/sdk/Metrics/Stream/MetricStreamInterface.php b/vendor/open-telemetry/sdk/Metrics/Stream/MetricStreamInterface.php
new file mode 100644
index 000000000..1373a1c93
--- /dev/null
+++ b/vendor/open-telemetry/sdk/Metrics/Stream/MetricStreamInterface.php
@@ -0,0 +1,58 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTelemetry\SDK\Metrics\Stream;
+
+use OpenTelemetry\SDK\Metrics\Data\DataInterface;
+use OpenTelemetry\SDK\Metrics\Data\Temporality;
+
+/**
+ * @internal
+ */
+interface MetricStreamInterface
+{
+ /**
+ * Returns the internal temporality of this stream.
+ *
+ * @return string|Temporality internal temporality
+ */
+ public function temporality();
+
+ /**
+ * Returns the last metric timestamp.
+ *
+ * @return int metric timestamp
+ */
+ public function timestamp(): int;
+
+ /**
+ * Pushes metric data to the stream.
+ *
+ * @param Metric $metric metric data to push
+ */
+ public function push(Metric $metric): void;
+
+ /**
+ * Registers a new reader with the given temporality.
+ *
+ * @param string|Temporality $temporality temporality to use
+ * @return int reader id
+ */
+ public function register($temporality): int;
+
+ /**
+ * Unregisters the given reader.
+ *
+ * @param int $reader reader id
+ */
+ public function unregister(int $reader): void;
+
+ /**
+ * Collects metric data for the given reader.
+ *
+ * @param int $reader reader id
+ * @return DataInterface metric data
+ */
+ public function collect(int $reader): DataInterface;
+}