]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/seastar/src/core/prometheus.cc
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / seastar / src / core / prometheus.cc
index e60194794bb3878460172c5f8bfce150bb1cff64..fee791c47707c37ae072012c2fb133f7444bcee8 100644 (file)
 #include <boost/range/algorithm.hpp>
 #include <boost/range/combine.hpp>
 #include <seastar/core/thread.hh>
+#include <seastar/core/loop.hh>
 
 namespace seastar {
 
+extern seastar::logger seastar_logger;
+
 namespace prometheus {
 namespace pm = io::prometheus::client;
 
@@ -51,8 +54,13 @@ static bool write_delimited_to(const google::protobuf::MessageLite& message,
         google::protobuf::io::ZeroCopyOutputStream* rawOutput) {
     google::protobuf::io::CodedOutputStream output(rawOutput);
 
+#if GOOGLE_PROTOBUF_VERSION >= 3004000
+    const size_t size = message.ByteSizeLong();
+    output.WriteVarint64(size);
+#else
     const int size = message.ByteSize();
     output.WriteVarint32(size);
+#endif
 
     uint8_t* buffer = output.GetDirectBufferForNBytesAndAdvance(size);
     if (buffer != nullptr) {