From fb1069e99ff0bb3e4b6b92d20a6da7d82806d9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 17 Apr 2020 14:54:40 +0200 Subject: [PATCH] Added support for GCC 4.8 in prometheus-cpp patch --- .../patches/serial_exposer.patch | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/deps/prometheus-cpp/patches/serial_exposer.patch b/deps/prometheus-cpp/patches/serial_exposer.patch index c0ffc8721..88d10d5a6 100644 --- a/deps/prometheus-cpp/patches/serial_exposer.patch +++ b/deps/prometheus-cpp/patches/serial_exposer.patch @@ -72,11 +72,11 @@ index 966d04a..17f7ef3 100644 + } // namespace prometheus diff --git a/pull/src/handler.cc b/pull/src/handler.cc -index ea94365..15dc09e 100644 +index ea94365..d04758f 100644 --- a/pull/src/handler.cc +++ b/pull/src/handler.cc @@ -150,5 +150,124 @@ std::vector MetricsHandler::CollectMetrics() const { - + return collected_metrics; } + @@ -153,10 +153,10 @@ index ea94365..15dc09e 100644 + headers.insert({ "Content-Type", "text/plain" }); + +#ifdef HAVE_ZLIB -+ auto acceptsGzip { IsEncodingAccepted(req_headers, "gzip") }; ++ auto acceptsGzip = IsEncodingAccepted(req_headers, "gzip"); + + if (acceptsGzip) { -+ auto compressed { GZipCompress(body) }; ++ auto compressed = GZipCompress(body); + + if (!compressed.empty()) { + headers.insert({"Content-Encoding", "gzip"}); @@ -182,14 +182,14 @@ index ea94365..15dc09e 100644 + // Execute the callback updating the metrics + this->update_callback_(); + -+ auto metrics { CollectMetrics() }; -+ auto serializer { std::unique_ptr{ new TextSerializer() } }; -+ auto headers_body { WriteResponse(req_headers, serializer->Serialize(metrics)) }; ++ auto metrics = CollectMetrics(); ++ auto serializer = std::unique_ptr{ new TextSerializer() }; ++ auto headers_body = WriteResponse(req_headers, serializer->Serialize(metrics)); + -+ auto stop_time_of_request { std::chrono::steady_clock::now() }; -+ auto duration { std::chrono::duration_cast( ++ auto stop_time_of_request = std::chrono::steady_clock::now(); ++ auto duration = std::chrono::duration_cast( + stop_time_of_request - start_time_of_request -+ )}; ++ ); + + request_latencies_.Observe(duration.count()); + bytes_transferred_.Increment(headers_body.second.size()); @@ -205,7 +205,7 @@ index 112267a..d603369 100644 --- a/pull/src/handler.h +++ b/pull/src/handler.h @@ -2,8 +2,9 @@ - + #include #include -