Skip to content

Commit

Permalink
Remove HttpResponse & OutputStream class in order to get rid of the d…
Browse files Browse the repository at this point in the history
…ependency to psr/http-message, #12

* Remove tests
* Update examples
  • Loading branch information
hollodotme committed May 4, 2024
1 parent 028c0dd commit 2774dfd
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 1,165 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a CHANGELOG](http://keepachangelog.com).

## [0.4.0] - 2024-05-04

* Dropped support for PHP 7.1
* Added support for PHP 8.3
* Removed `HttpResponse` class in order to get rid of the dependency to `psr/http-message` — see [#12]
* Users must implement or use their own response class to publish the metrics via HTTP
* Fix deprecation warnings for IteratorAggregate since PHP 8.1 — see [#8]
* Moved CI to GitHub Actions

[#12]: https://github.com/openmetrics-php/exposition-text/issues/12

[#8]: https://github.com/openmetrics-php/exposition-text/issues/8

## [0.3.1] - 2019-02-19

### Fixed
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
}
],
"require": {
"php": "^7.2 || ^8.0",
"psr/http-message": "^1.0"
"php": "^7.2 || ^8.0"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 1 addition & 2 deletions examples/counters.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use OpenMetricsPhp\Exposition\Text\Collections\CounterCollection;
use OpenMetricsPhp\Exposition\Text\Collections\LabelCollection;
use OpenMetricsPhp\Exposition\Text\HttpResponse;
use OpenMetricsPhp\Exposition\Text\Metrics\Counter;
use OpenMetricsPhp\Exposition\Text\Types\Label;
use OpenMetricsPhp\Exposition\Text\Types\MetricName;
Expand Down Expand Up @@ -45,4 +44,4 @@
Counter::fromValueAndTimestamp( 8, time() )->withLabelCollection( $labels )
);

HttpResponse::fromMetricCollections( $counters )->respond();
echo $counters->getMetricsString();
3 changes: 1 addition & 2 deletions examples/gauges.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use OpenMetricsPhp\Exposition\Text\Collections\GaugeCollection;
use OpenMetricsPhp\Exposition\Text\Collections\LabelCollection;
use OpenMetricsPhp\Exposition\Text\HttpResponse;
use OpenMetricsPhp\Exposition\Text\Metrics\Gauge;
use OpenMetricsPhp\Exposition\Text\Types\Label;
use OpenMetricsPhp\Exposition\Text\Types\MetricName;
Expand Down Expand Up @@ -42,4 +41,4 @@
Gauge::fromValueAndTimestamp( 23.4, time() )->withLabelCollection( $labels )
);

HttpResponse::fromMetricCollections( $gauges )->respond();
echo $gauges->getMetricsString();
3 changes: 1 addition & 2 deletions examples/histogram.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace YourVendor\YourProject;

use OpenMetricsPhp\Exposition\Text\Collections\GaugeCollection;
use OpenMetricsPhp\Exposition\Text\HttpResponse;
use OpenMetricsPhp\Exposition\Text\Metrics\Gauge;
use OpenMetricsPhp\Exposition\Text\Metrics\Histogram;
use OpenMetricsPhp\Exposition\Text\Types\MetricName;
Expand All @@ -23,4 +22,4 @@
$histogram = Histogram::fromGaugeCollectionWithBounds( $gauges, [30, 46, 78.9, 90], '_histogram' )
->withHelp( 'Explanation of the histogram' );

HttpResponse::fromMetricCollections( $histogram )->respond();
echo $histogram->getMetricsString();
3 changes: 1 addition & 2 deletions examples/summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace YourVendor\YourProject;

use OpenMetricsPhp\Exposition\Text\Collections\GaugeCollection;
use OpenMetricsPhp\Exposition\Text\HttpResponse;
use OpenMetricsPhp\Exposition\Text\Metrics\Gauge;
use OpenMetricsPhp\Exposition\Text\Metrics\Summary;
use OpenMetricsPhp\Exposition\Text\Types\MetricName;
Expand All @@ -23,4 +22,4 @@
$summary = Summary::fromGaugeCollectionWithQuantiles( $gauges, [0.3, 0.5, 0.75, 0.9], '_summary' )
->withHelp( 'Explanation of the summary' );

HttpResponse::fromMetricCollections( $summary )->respond();
echo $summary->getMetricsString();
179 changes: 0 additions & 179 deletions src/HttpResponse.php

This file was deleted.

Loading

0 comments on commit 2774dfd

Please sign in to comment.