Commit fa8ad6fe authored by Brian Brazil's avatar Brian Brazil

Merge pull request #9 from brian-brazil/histogram

Add Histogram metric type
parents bc9454ca 086fe7ca
......@@ -40,6 +40,12 @@ const ::google::protobuf::internal::GeneratedMessageReflection*
const ::google::protobuf::Descriptor* Untyped_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Untyped_reflection_ = NULL;
const ::google::protobuf::Descriptor* Histogram_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Histogram_reflection_ = NULL;
const ::google::protobuf::Descriptor* Bucket_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Bucket_reflection_ = NULL;
const ::google::protobuf::Descriptor* Metric_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Metric_reflection_ = NULL;
......@@ -151,13 +157,47 @@ void protobuf_AssignDesc_metrics_2eproto() {
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Untyped));
Metric_descriptor_ = file->message_type(6);
static const int Metric_offsets_[6] = {
Histogram_descriptor_ = file->message_type(6);
static const int Histogram_offsets_[3] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Histogram, sample_count_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Histogram, sample_sum_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Histogram, bucket_),
};
Histogram_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
Histogram_descriptor_,
Histogram::default_instance_,
Histogram_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Histogram, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Histogram, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Histogram));
Bucket_descriptor_ = file->message_type(7);
static const int Bucket_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Bucket, cumulative_count_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Bucket, upper_bound_),
};
Bucket_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
Bucket_descriptor_,
Bucket::default_instance_,
Bucket_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Bucket, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Bucket, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Bucket));
Metric_descriptor_ = file->message_type(8);
static const int Metric_offsets_[7] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, label_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, gauge_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, counter_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, summary_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, untyped_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, histogram_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Metric, timestamp_ms_),
};
Metric_reflection_ =
......@@ -171,7 +211,7 @@ void protobuf_AssignDesc_metrics_2eproto() {
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Metric));
MetricFamily_descriptor_ = file->message_type(7);
MetricFamily_descriptor_ = file->message_type(9);
static const int MetricFamily_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MetricFamily, name_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MetricFamily, help_),
......@@ -214,6 +254,10 @@ void protobuf_RegisterTypes(const ::std::string&) {
Summary_descriptor_, &Summary::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Untyped_descriptor_, &Untyped::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Histogram_descriptor_, &Histogram::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Bucket_descriptor_, &Bucket::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Metric_descriptor_, &Metric::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
......@@ -235,6 +279,10 @@ void protobuf_ShutdownFile_metrics_2eproto() {
delete Summary_reflection_;
delete Untyped::default_instance_;
delete Untyped_reflection_;
delete Histogram::default_instance_;
delete Histogram_reflection_;
delete Bucket::default_instance_;
delete Bucket_reflection_;
delete Metric::default_instance_;
delete Metric_reflection_;
delete MetricFamily::default_instance_;
......@@ -255,19 +303,25 @@ void protobuf_AddDesc_metrics_2eproto() {
"\r\n\005value\030\002 \001(\001\"e\n\007Summary\022\024\n\014sample_coun"
"t\030\001 \001(\004\022\022\n\nsample_sum\030\002 \001(\001\0220\n\010quantile\030"
"\003 \003(\0132\036.io.prometheus.client.Quantile\"\030\n"
"\007Untyped\022\r\n\005value\030\001 \001(\001\"\212\002\n\006Metric\022.\n\005la"
"bel\030\001 \003(\0132\037.io.prometheus.client.LabelPa"
"ir\022*\n\005gauge\030\002 \001(\0132\033.io.prometheus.client"
".Gauge\022.\n\007counter\030\003 \001(\0132\035.io.prometheus."
"client.Counter\022.\n\007summary\030\004 \001(\0132\035.io.pro"
"metheus.client.Summary\022.\n\007untyped\030\005 \001(\0132"
"\035.io.prometheus.client.Untyped\022\024\n\014timest"
"amp_ms\030\006 \001(\003\"\210\001\n\014MetricFamily\022\014\n\004name\030\001 "
"\001(\t\022\014\n\004help\030\002 \001(\t\022.\n\004type\030\003 \001(\0162 .io.pro"
"metheus.client.MetricType\022,\n\006metric\030\004 \003("
"\0132\034.io.prometheus.client.Metric*>\n\nMetri"
"cType\022\013\n\007COUNTER\020\000\022\t\n\005GAUGE\020\001\022\013\n\007SUMMARY"
"\020\002\022\013\n\007UNTYPED\020\003B\026\n\024io.prometheus.client", 799);
"\007Untyped\022\r\n\005value\030\001 \001(\001\"c\n\tHistogram\022\024\n\014"
"sample_count\030\001 \001(\004\022\022\n\nsample_sum\030\002 \001(\001\022,"
"\n\006bucket\030\003 \003(\0132\034.io.prometheus.client.Bu"
"cket\"7\n\006Bucket\022\030\n\020cumulative_count\030\001 \001(\004"
"\022\023\n\013upper_bound\030\002 \001(\001\"\276\002\n\006Metric\022.\n\005labe"
"l\030\001 \003(\0132\037.io.prometheus.client.LabelPair"
"\022*\n\005gauge\030\002 \001(\0132\033.io.prometheus.client.G"
"auge\022.\n\007counter\030\003 \001(\0132\035.io.prometheus.cl"
"ient.Counter\022.\n\007summary\030\004 \001(\0132\035.io.prome"
"theus.client.Summary\022.\n\007untyped\030\005 \001(\0132\035."
"io.prometheus.client.Untyped\0222\n\thistogra"
"m\030\007 \001(\0132\037.io.prometheus.client.Histogram"
"\022\024\n\014timestamp_ms\030\006 \001(\003\"\210\001\n\014MetricFamily\022"
"\014\n\004name\030\001 \001(\t\022\014\n\004help\030\002 \001(\t\022.\n\004type\030\003 \001("
"\0162 .io.prometheus.client.MetricType\022,\n\006m"
"etric\030\004 \003(\0132\034.io.prometheus.client.Metri"
"c*M\n\nMetricType\022\013\n\007COUNTER\020\000\022\t\n\005GAUGE\020\001\022"
"\013\n\007SUMMARY\020\002\022\013\n\007UNTYPED\020\003\022\r\n\tHISTOGRAM\020\004"
"B\026\n\024io.prometheus.client", 1024);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"metrics.proto", &protobuf_RegisterTypes);
LabelPair::default_instance_ = new LabelPair();
......@@ -276,6 +330,8 @@ void protobuf_AddDesc_metrics_2eproto() {
Quantile::default_instance_ = new Quantile();
Summary::default_instance_ = new Summary();
Untyped::default_instance_ = new Untyped();
Histogram::default_instance_ = new Histogram();
Bucket::default_instance_ = new Bucket();
Metric::default_instance_ = new Metric();
MetricFamily::default_instance_ = new MetricFamily();
LabelPair::default_instance_->InitAsDefaultInstance();
......@@ -284,6 +340,8 @@ void protobuf_AddDesc_metrics_2eproto() {
Quantile::default_instance_->InitAsDefaultInstance();
Summary::default_instance_->InitAsDefaultInstance();
Untyped::default_instance_->InitAsDefaultInstance();
Histogram::default_instance_->InitAsDefaultInstance();
Bucket::default_instance_->InitAsDefaultInstance();
Metric::default_instance_->InitAsDefaultInstance();
MetricFamily::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_metrics_2eproto);
......@@ -305,6 +363,7 @@ bool MetricType_IsValid(int value) {
case 1:
case 2:
case 3:
case 4:
return true;
default:
return false;
......@@ -322,6 +381,7 @@ const int LabelPair::kValueFieldNumber;
LabelPair::LabelPair()
: ::google::protobuf::Message() {
SharedCtor();
// @@protoc_insertion_point(constructor:io.prometheus.client.LabelPair)
}
void LabelPair::InitAsDefaultInstance() {
......@@ -331,24 +391,27 @@ LabelPair::LabelPair(const LabelPair& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:io.prometheus.client.LabelPair)
}
void LabelPair::SharedCtor() {
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
LabelPair::~LabelPair() {
// @@protoc_insertion_point(destructor:io.prometheus.client.LabelPair)
SharedDtor();
}
void LabelPair::SharedDtor() {
if (name_ != &::google::protobuf::internal::kEmptyString) {
if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete name_;
}
if (value_ != &::google::protobuf::internal::kEmptyString) {
if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
delete value_;
}
if (this != default_instance_) {
......@@ -377,14 +440,14 @@ LabelPair* LabelPair::New() const {
}
void LabelPair::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (_has_bits_[0 / 32] & 3) {
if (has_name()) {
if (name_ != &::google::protobuf::internal::kEmptyString) {
if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
name_->clear();
}
}
if (has_value()) {
if (value_ != &::google::protobuf::internal::kEmptyString) {
if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
value_->clear();
}
}
......@@ -395,21 +458,25 @@ void LabelPair::Clear() {
bool LabelPair::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
// @@protoc_insertion_point(parse_start:io.prometheus.client.LabelPair)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// optional string name = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
if (tag == 10) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_name()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->name().data(), this->name().length(),
::google::protobuf::internal::WireFormat::PARSE);
::google::protobuf::internal::WireFormat::PARSE,
"name");
} else {
goto handle_uninterpreted;
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_value;
break;
......@@ -417,26 +484,27 @@ bool LabelPair::MergePartialFromCodedStream(
// optional string value = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
if (tag == 18) {
parse_value:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_value()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->value().data(), this->value().length(),
::google::protobuf::internal::WireFormat::PARSE);
::google::protobuf::internal::WireFormat::PARSE,
"value");
} else {
goto handle_uninterpreted;
goto handle_unusual;
}
if (input->ExpectAtEnd()) return true;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
......@@ -444,27 +512,35 @@ bool LabelPair::MergePartialFromCodedStream(
}
}
}
success:
// @@protoc_insertion_point(parse_success:io.prometheus.client.LabelPair)
return true;
failure:
// @@protoc_insertion_point(parse_failure:io.prometheus.client.LabelPair)
return false;
#undef DO_
}
void LabelPair::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:io.prometheus.client.LabelPair)
// optional string name = 1;
if (has_name()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->name().data(), this->name().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
::google::protobuf::internal::WireFormat::SERIALIZE,
"name");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
1, this->name(), output);
}
// optional string value = 2;
if (has_value()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->value().data(), this->value().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
::google::protobuf::internal::WireFormat::SERIALIZE,
"value");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
2, this->value(), output);
}
......@@ -472,15 +548,18 @@ void LabelPair::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:io.prometheus.client.LabelPair)
}
::google::protobuf::uint8* LabelPair::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.LabelPair)
// optional string name = 1;
if (has_name()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->name().data(), this->name().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormat::SERIALIZE,
"name");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1, this->name(), target);
......@@ -488,9 +567,10 @@ void LabelPair::SerializeWithCachedSizes(
// optional string value = 2;
if (has_value()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->value().data(), this->value().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormat::SERIALIZE,
"value");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->value(), target);
......@@ -500,6 +580,7 @@ void LabelPair::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.LabelPair)
return target;
}
......@@ -603,6 +684,7 @@ const int Gauge::kValueFieldNumber;
Gauge::Gauge()
: ::google::protobuf::Message() {
SharedCtor();
// @@protoc_insertion_point(constructor:io.prometheus.client.Gauge)
}
void Gauge::InitAsDefaultInstance() {
......@@ -612,6 +694,7 @@ Gauge::Gauge(const Gauge& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:io.prometheus.client.Gauge)
}
void Gauge::SharedCtor() {
......@@ -621,6 +704,7 @@ void Gauge::SharedCtor() {
}
Gauge::~Gauge() {
// @@protoc_insertion_point(destructor:io.prometheus.client.Gauge)
SharedDtor();
}
......@@ -651,39 +735,41 @@ Gauge* Gauge::New() const {
}
void Gauge::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
value_ = 0;
}
value_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Gauge::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
// @@protoc_insertion_point(parse_start:io.prometheus.client.Gauge)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// optional double value = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
if (tag == 9) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
input, &value_)));
set_has_value();
} else {
goto handle_uninterpreted;
goto handle_unusual;
}
if (input->ExpectAtEnd()) return true;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
......@@ -691,12 +777,18 @@ bool Gauge::MergePartialFromCodedStream(
}
}
}
success:
// @@protoc_insertion_point(parse_success:io.prometheus.client.Gauge)
return true;
failure:
// @@protoc_insertion_point(parse_failure:io.prometheus.client.Gauge)
return false;
#undef DO_
}
void Gauge::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:io.prometheus.client.Gauge)
// optional double value = 1;
if (has_value()) {
::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->value(), output);
......@@ -706,10 +798,12 @@ void Gauge::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:io.prometheus.client.Gauge)
}
::google::protobuf::uint8* Gauge::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.Gauge)
// optional double value = 1;
if (has_value()) {
target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->value(), target);
......@@ -719,6 +813,7 @@ void Gauge::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.Gauge)
return target;
}
......@@ -809,6 +904,7 @@ const int Counter::kValueFieldNumber;
Counter::Counter()
: ::google::protobuf::Message() {
SharedCtor();
// @@protoc_insertion_point(constructor:io.prometheus.client.Counter)
}
void Counter::InitAsDefaultInstance() {
......@@ -818,6 +914,7 @@ Counter::Counter(const Counter& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:io.prometheus.client.Counter)
}
void Counter::SharedCtor() {
......@@ -827,6 +924,7 @@ void Counter::SharedCtor() {
}
Counter::~Counter() {
// @@protoc_insertion_point(destructor:io.prometheus.client.Counter)
SharedDtor();
}
......@@ -857,39 +955,41 @@ Counter* Counter::New() const {
}
void Counter::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
value_ = 0;
}
value_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Counter::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
// @@protoc_insertion_point(parse_start:io.prometheus.client.Counter)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// optional double value = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
if (tag == 9) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
input, &value_)));
set_has_value();
} else {
goto handle_uninterpreted;
goto handle_unusual;
}
if (input->ExpectAtEnd()) return true;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
......@@ -897,12 +997,18 @@ bool Counter::MergePartialFromCodedStream(
}
}
}
success:
// @@protoc_insertion_point(parse_success:io.prometheus.client.Counter)
return true;
failure:
// @@protoc_insertion_point(parse_failure:io.prometheus.client.Counter)
return false;
#undef DO_
}
void Counter::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:io.prometheus.client.Counter)
// optional double value = 1;
if (has_value()) {
::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->value(), output);
......@@ -912,10 +1018,12 @@ void Counter::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:io.prometheus.client.Counter)
}
::google::protobuf::uint8* Counter::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.Counter)
// optional double value = 1;
if (has_value()) {
target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->value(), target);
......@@ -925,6 +1033,7 @@ void Counter::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:io.prometheus.client.Counter)
return target;
}
......@@ -1016,6 +1125,7 @@ const int Quantile::kValueFieldNumber;
Quantile::Quantile()
: ::google::protobuf::Message() {
SharedCtor();
// @@protoc_insertion_point(constructor:io.prometheus.client.Quantile)
}
void Quantile::InitAsDefaultInstance() {
......@@ -1025,6 +1135,7 @@ Quantile::Quantile(const Quantile& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:io.prometheus.client.Quantile)
}
void Quantile::SharedCtor() {
......@@ -1035,6 +1146,7 @@ void Quantile::SharedCtor() {
}
Quantile::~Quantile() {
// @@protoc_insertion_point(destructor:io.prometheus.client.Quantile)
SharedDtor();
}
......@@ -1065,30 +1177,44 @@ Quantile* Quantile::New() const {
}
void Quantile::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
quantile_ = 0;
value_ = 0;
}
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<Quantile*>(16)->f) - \
reinterpret_cast<char*>(16))
#define ZR_(first, last) do { \
size_t f = OFFSET_OF_FIELD_(first); \
size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
::memset(&first, 0, n); \
} while (0)
ZR_(quantile_, value_);
#undef OFFSET_OF_FIELD_
#undef ZR_
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Quantile::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
// @@protoc_insertion_point(parse_start:io.prometheus.client.Quantile)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// optional double quantile = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
if (tag == 9) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
input, &quantile_)));
set_has_quantile();
} else {
goto handle_uninterpreted;
goto handle_unusual;
}
if (input->ExpectTag(17)) goto parse_value;
break;
......@@ -1096,25 +1222,25 @@ bool Quantile::MergePartialFromCodedStream(
// optional double value = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
if (tag == 17) {
parse_value:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
input, &value_)));
set_has_value();
} else {
goto handle_uninterpreted;
goto handle_unusual;
}
if (input->ExpectAtEnd()) return true;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
......@@ -1122,12 +1248,18 @@ bool Quantile::MergePartialFromCodedStream(
}
}
}
success:
// @@protoc_insertion_point(parse_success:io.prometheus.client.Quantile)
return true;
failure:
// @@protoc_insertion_point(parse_failure:io.prometheus.client.Quantile)
return false;
#undef DO_
}
void Quantile::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:io.prometheus.client.Quantile)
// optional double quantile = 1;
if (has_quantile()) {
::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->quantile(), output);
......@@ -1142,10 +1274,12 @@ void Quantile::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:io.prometheus.client.Quantile)
}
::google::protobuf::uint8* Quantile::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:io.prometheus.client.Quantile)
// optional double quantile = 1;