From 38d839d81051f86ec4daaa3551c891592558d8ad Mon Sep 17 00:00:00 2001 From: "Matt T. Proud" Date: Wed, 8 May 2013 21:15:47 +0200 Subject: [PATCH] Include generated Protocol Buffers artifacts. This commit reduces the general compile time dependencies to omit the Protocol Buffer compiler and the Go Protocol Buffer generator tool. The build steps to furnish them still remain, but they can optionally be called if data.proto or config.proto are under work. --- build/Makefile | 7 +- config/Makefile | 17 +- config/generated/.gitignore | 1 - config/generated/config.pb.go | 180 +++++++++++++++++++ model/Makefile | 19 +- model/generated/.gitignore | 2 - model/generated/data.pb.go | 299 ++++++++++++++++++++++++++++++++ model/generated/descriptor.blob | Bin 0 -> 5071 bytes 8 files changed, 498 insertions(+), 27 deletions(-) delete mode 100644 config/generated/.gitignore create mode 100644 config/generated/config.pb.go delete mode 100644 model/generated/.gitignore create mode 100644 model/generated/data.pb.go create mode 100644 model/generated/descriptor.blob diff --git a/build/Makefile b/build/Makefile index bcf7fedf23..3aa007b4dc 100644 --- a/build/Makefile +++ b/build/Makefile @@ -52,11 +52,14 @@ go-stamp: gvm-stamp [ -x "$$(which go)" ] || { echo "go not found." ; false ; } touch $@ -goprotobuf-stamp: go-stamp mercurial-stamp protoc-stamp - $(GO_GET) code.google.com/p/goprotobuf/proto $(THIRD_PARTY_BUILD_OUTPUT) +goprotobuf-protoc-gen-go-stamp: protoc-stamp $(GO_GET) code.google.com/p/goprotobuf/protoc-gen-go $(THIRD_PARTY_BUILD_OUTPUT) touch $@ +goprotobuf-stamp: go-stamp mercurial-stamp + $(GO_GET) code.google.com/p/goprotobuf/proto $(THIRD_PARTY_BUILD_OUTPUT) + touch $@ + gorest-stamp: go-stamp $(GO_GET) code.google.com/p/gorest $(THIRD_PARTY_BUILD_OUTPUT) touch $@ diff --git a/config/Makefile b/config/Makefile index df2497c2cc..7418444232 100644 --- a/config/Makefile +++ b/config/Makefile @@ -15,18 +15,13 @@ all: generated SUFFIXES: -MAKE_ARTIFACTS = generated-stamp - include ../Makefile.INCLUDE -generated: generated-stamp +# In order to build the generated targets in this directory, run the +# following: +# +# make -C build goprotobuf-protoc-gen-go-stamp -generated-stamp: config.proto + +generated/config.pb.go: config.proto protoc --proto_path=$(PREFIX)/include:. --go_out=generated/ config.proto - touch $@ - -clean: - rm -rf generated/* - -rm -f $(MAKE_ARTIFACTS) - -.PHONY: generated diff --git a/config/generated/.gitignore b/config/generated/.gitignore deleted file mode 100644 index 56086905e7..0000000000 --- a/config/generated/.gitignore +++ /dev/null @@ -1 +0,0 @@ -config.pb.go diff --git a/config/generated/config.pb.go b/config/generated/config.pb.go new file mode 100644 index 0000000000..9fb91bcaa9 --- /dev/null +++ b/config/generated/config.pb.go @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-go. +// source: config.proto +// DO NOT EDIT! + +package io_prometheus + +import proto "code.google.com/p/goprotobuf/proto" +import json "encoding/json" +import math "math" + +// Reference proto, json, and math imports to suppress error if they are not otherwise used. +var _ = proto.Marshal +var _ = &json.SyntaxError{} +var _ = math.Inf + +type LabelPair struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *LabelPair) Reset() { *m = LabelPair{} } +func (m *LabelPair) String() string { return proto.CompactTextString(m) } +func (*LabelPair) ProtoMessage() {} + +func (m *LabelPair) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *LabelPair) GetValue() string { + if m != nil && m.Value != nil { + return *m.Value + } + return "" +} + +type LabelPairs struct { + Label []*LabelPair `protobuf:"bytes,1,rep,name=label" json:"label,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *LabelPairs) Reset() { *m = LabelPairs{} } +func (m *LabelPairs) String() string { return proto.CompactTextString(m) } +func (*LabelPairs) ProtoMessage() {} + +func (m *LabelPairs) GetLabel() []*LabelPair { + if m != nil { + return m.Label + } + return nil +} + +type GlobalConfig struct { + ScrapeInterval *string `protobuf:"bytes,1,opt,name=scrape_interval,def=1m" json:"scrape_interval,omitempty"` + EvaluationInterval *string `protobuf:"bytes,2,opt,name=evaluation_interval,def=1m" json:"evaluation_interval,omitempty"` + Labels *LabelPairs `protobuf:"bytes,3,opt,name=labels" json:"labels,omitempty"` + RuleFile []string `protobuf:"bytes,4,rep,name=rule_file" json:"rule_file,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GlobalConfig) Reset() { *m = GlobalConfig{} } +func (m *GlobalConfig) String() string { return proto.CompactTextString(m) } +func (*GlobalConfig) ProtoMessage() {} + +const Default_GlobalConfig_ScrapeInterval string = "1m" +const Default_GlobalConfig_EvaluationInterval string = "1m" + +func (m *GlobalConfig) GetScrapeInterval() string { + if m != nil && m.ScrapeInterval != nil { + return *m.ScrapeInterval + } + return Default_GlobalConfig_ScrapeInterval +} + +func (m *GlobalConfig) GetEvaluationInterval() string { + if m != nil && m.EvaluationInterval != nil { + return *m.EvaluationInterval + } + return Default_GlobalConfig_EvaluationInterval +} + +func (m *GlobalConfig) GetLabels() *LabelPairs { + if m != nil { + return m.Labels + } + return nil +} + +func (m *GlobalConfig) GetRuleFile() []string { + if m != nil { + return m.RuleFile + } + return nil +} + +type TargetGroup struct { + Target []string `protobuf:"bytes,1,rep,name=target" json:"target,omitempty"` + Labels *LabelPairs `protobuf:"bytes,2,opt,name=labels" json:"labels,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *TargetGroup) Reset() { *m = TargetGroup{} } +func (m *TargetGroup) String() string { return proto.CompactTextString(m) } +func (*TargetGroup) ProtoMessage() {} + +func (m *TargetGroup) GetTarget() []string { + if m != nil { + return m.Target + } + return nil +} + +func (m *TargetGroup) GetLabels() *LabelPairs { + if m != nil { + return m.Labels + } + return nil +} + +type JobConfig struct { + Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` + ScrapeInterval *string `protobuf:"bytes,2,opt,name=scrape_interval" json:"scrape_interval,omitempty"` + TargetGroup []*TargetGroup `protobuf:"bytes,3,rep,name=target_group" json:"target_group,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *JobConfig) Reset() { *m = JobConfig{} } +func (m *JobConfig) String() string { return proto.CompactTextString(m) } +func (*JobConfig) ProtoMessage() {} + +func (m *JobConfig) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *JobConfig) GetScrapeInterval() string { + if m != nil && m.ScrapeInterval != nil { + return *m.ScrapeInterval + } + return "" +} + +func (m *JobConfig) GetTargetGroup() []*TargetGroup { + if m != nil { + return m.TargetGroup + } + return nil +} + +type PrometheusConfig struct { + Global *GlobalConfig `protobuf:"bytes,1,opt,name=global" json:"global,omitempty"` + Job []*JobConfig `protobuf:"bytes,2,rep,name=job" json:"job,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *PrometheusConfig) Reset() { *m = PrometheusConfig{} } +func (m *PrometheusConfig) String() string { return proto.CompactTextString(m) } +func (*PrometheusConfig) ProtoMessage() {} + +func (m *PrometheusConfig) GetGlobal() *GlobalConfig { + if m != nil { + return m.Global + } + return nil +} + +func (m *PrometheusConfig) GetJob() []*JobConfig { + if m != nil { + return m.Job + } + return nil +} + +func init() { +} diff --git a/model/Makefile b/model/Makefile index 55555b83a9..0c1f25fd18 100644 --- a/model/Makefile +++ b/model/Makefile @@ -11,22 +11,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -all: generated +all: generated/data.pb.go generated/descriptor.blob SUFFIXES: -MAKE_ARTIFACTS = generated-stamp - include ../Makefile.INCLUDE -generated: generated-stamp +# In order to build the generated targets in this directory, run the +# following: +# +# make -C build goprotobuf-protoc-gen-go-stamp -generated-stamp: data.proto +generated/data.pb.go: data.proto protoc --proto_path=$(PREFIX)/include:. --include_imports --go_out=generated/ --descriptor_set_out=generated/descriptor.blob data.proto - touch $@ -clean: - rm -rf generated/* - -rm -f $(MAKE_ARTIFACTS) - -.PHONY: clean generated +generated/descriptor.blob: data.proto + protoc --proto_path=$(PREFIX)/include:. --include_imports --go_out=generated/ --descriptor_set_out=generated/descriptor.blob data.proto diff --git a/model/generated/.gitignore b/model/generated/.gitignore deleted file mode 100644 index e590fda01c..0000000000 --- a/model/generated/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -data.pb.go -descriptor.blob \ No newline at end of file diff --git a/model/generated/data.pb.go b/model/generated/data.pb.go new file mode 100644 index 0000000000..d1ca868f56 --- /dev/null +++ b/model/generated/data.pb.go @@ -0,0 +1,299 @@ +// Code generated by protoc-gen-go. +// source: data.proto +// DO NOT EDIT! + +package io_prometheus + +import proto "code.google.com/p/goprotobuf/proto" +import json "encoding/json" +import math "math" + +// discarding unused import google_protobuf "google/protobuf/descriptor.pb" + +// Reference proto, json, and math imports to suppress error if they are not otherwise used. +var _ = proto.Marshal +var _ = &json.SyntaxError{} +var _ = math.Inf + +type LabelPair struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *LabelPair) Reset() { *m = LabelPair{} } +func (m *LabelPair) String() string { return proto.CompactTextString(m) } +func (*LabelPair) ProtoMessage() {} + +func (m *LabelPair) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *LabelPair) GetValue() string { + if m != nil && m.Value != nil { + return *m.Value + } + return "" +} + +type LabelName struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *LabelName) Reset() { *m = LabelName{} } +func (m *LabelName) String() string { return proto.CompactTextString(m) } +func (*LabelName) ProtoMessage() {} + +func (m *LabelName) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +type Metric struct { + LabelPair []*LabelPair `protobuf:"bytes,1,rep,name=label_pair" json:"label_pair,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Metric) Reset() { *m = Metric{} } +func (m *Metric) String() string { return proto.CompactTextString(m) } +func (*Metric) ProtoMessage() {} + +func (m *Metric) GetLabelPair() []*LabelPair { + if m != nil { + return m.LabelPair + } + return nil +} + +type Fingerprint struct { + Signature *string `protobuf:"bytes,1,opt,name=signature" json:"signature,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Fingerprint) Reset() { *m = Fingerprint{} } +func (m *Fingerprint) String() string { return proto.CompactTextString(m) } +func (*Fingerprint) ProtoMessage() {} + +func (m *Fingerprint) GetSignature() string { + if m != nil && m.Signature != nil { + return *m.Signature + } + return "" +} + +type FingerprintCollection struct { + Member []*Fingerprint `protobuf:"bytes,1,rep,name=member" json:"member,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *FingerprintCollection) Reset() { *m = FingerprintCollection{} } +func (m *FingerprintCollection) String() string { return proto.CompactTextString(m) } +func (*FingerprintCollection) ProtoMessage() {} + +func (m *FingerprintCollection) GetMember() []*Fingerprint { + if m != nil { + return m.Member + } + return nil +} + +type LabelSet struct { + Member []*LabelPair `protobuf:"bytes,1,rep,name=member" json:"member,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *LabelSet) Reset() { *m = LabelSet{} } +func (m *LabelSet) String() string { return proto.CompactTextString(m) } +func (*LabelSet) ProtoMessage() {} + +func (m *LabelSet) GetMember() []*LabelPair { + if m != nil { + return m.Member + } + return nil +} + +type SampleKey struct { + Fingerprint *Fingerprint `protobuf:"bytes,1,opt,name=fingerprint" json:"fingerprint,omitempty"` + Timestamp []byte `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp,omitempty"` + LastTimestamp *int64 `protobuf:"fixed64,3,opt,name=last_timestamp" json:"last_timestamp,omitempty"` + SampleCount *uint32 `protobuf:"fixed32,4,opt,name=sample_count" json:"sample_count,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SampleKey) Reset() { *m = SampleKey{} } +func (m *SampleKey) String() string { return proto.CompactTextString(m) } +func (*SampleKey) ProtoMessage() {} + +func (m *SampleKey) GetFingerprint() *Fingerprint { + if m != nil { + return m.Fingerprint + } + return nil +} + +func (m *SampleKey) GetTimestamp() []byte { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *SampleKey) GetLastTimestamp() int64 { + if m != nil && m.LastTimestamp != nil { + return *m.LastTimestamp + } + return 0 +} + +func (m *SampleKey) GetSampleCount() uint32 { + if m != nil && m.SampleCount != nil { + return *m.SampleCount + } + return 0 +} + +type SampleValueSeries struct { + Value []*SampleValueSeries_Value `protobuf:"bytes,1,rep,name=value" json:"value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SampleValueSeries) Reset() { *m = SampleValueSeries{} } +func (m *SampleValueSeries) String() string { return proto.CompactTextString(m) } +func (*SampleValueSeries) ProtoMessage() {} + +func (m *SampleValueSeries) GetValue() []*SampleValueSeries_Value { + if m != nil { + return m.Value + } + return nil +} + +type SampleValueSeries_Value struct { + Timestamp *int64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` + Value *float64 `protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SampleValueSeries_Value) Reset() { *m = SampleValueSeries_Value{} } +func (m *SampleValueSeries_Value) String() string { return proto.CompactTextString(m) } +func (*SampleValueSeries_Value) ProtoMessage() {} + +func (m *SampleValueSeries_Value) GetTimestamp() int64 { + if m != nil && m.Timestamp != nil { + return *m.Timestamp + } + return 0 +} + +func (m *SampleValueSeries_Value) GetValue() float64 { + if m != nil && m.Value != nil { + return *m.Value + } + return 0 +} + +type MembershipIndexValue struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *MembershipIndexValue) Reset() { *m = MembershipIndexValue{} } +func (m *MembershipIndexValue) String() string { return proto.CompactTextString(m) } +func (*MembershipIndexValue) ProtoMessage() {} + +type MetricHighWatermark struct { + Timestamp *int64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MetricHighWatermark) Reset() { *m = MetricHighWatermark{} } +func (m *MetricHighWatermark) String() string { return proto.CompactTextString(m) } +func (*MetricHighWatermark) ProtoMessage() {} + +func (m *MetricHighWatermark) GetTimestamp() int64 { + if m != nil && m.Timestamp != nil { + return *m.Timestamp + } + return 0 +} + +type CompactionProcessorDefinition struct { + MinimumGroupSize *uint32 `protobuf:"varint,1,opt,name=minimum_group_size" json:"minimum_group_size,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *CompactionProcessorDefinition) Reset() { *m = CompactionProcessorDefinition{} } +func (m *CompactionProcessorDefinition) String() string { return proto.CompactTextString(m) } +func (*CompactionProcessorDefinition) ProtoMessage() {} + +func (m *CompactionProcessorDefinition) GetMinimumGroupSize() uint32 { + if m != nil && m.MinimumGroupSize != nil { + return *m.MinimumGroupSize + } + return 0 +} + +type CurationKey struct { + Fingerprint *Fingerprint `protobuf:"bytes,1,opt,name=fingerprint" json:"fingerprint,omitempty"` + ProcessorMessageTypeName *string `protobuf:"bytes,2,opt,name=processor_message_type_name" json:"processor_message_type_name,omitempty"` + ProcessorMessageRaw []byte `protobuf:"bytes,3,opt,name=processor_message_raw" json:"processor_message_raw,omitempty"` + IgnoreYoungerThan *int64 `protobuf:"varint,4,opt,name=ignore_younger_than" json:"ignore_younger_than,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *CurationKey) Reset() { *m = CurationKey{} } +func (m *CurationKey) String() string { return proto.CompactTextString(m) } +func (*CurationKey) ProtoMessage() {} + +func (m *CurationKey) GetFingerprint() *Fingerprint { + if m != nil { + return m.Fingerprint + } + return nil +} + +func (m *CurationKey) GetProcessorMessageTypeName() string { + if m != nil && m.ProcessorMessageTypeName != nil { + return *m.ProcessorMessageTypeName + } + return "" +} + +func (m *CurationKey) GetProcessorMessageRaw() []byte { + if m != nil { + return m.ProcessorMessageRaw + } + return nil +} + +func (m *CurationKey) GetIgnoreYoungerThan() int64 { + if m != nil && m.IgnoreYoungerThan != nil { + return *m.IgnoreYoungerThan + } + return 0 +} + +type CurationValue struct { + LastCompletionTimestamp *int64 `protobuf:"varint,1,opt,name=last_completion_timestamp" json:"last_completion_timestamp,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *CurationValue) Reset() { *m = CurationValue{} } +func (m *CurationValue) String() string { return proto.CompactTextString(m) } +func (*CurationValue) ProtoMessage() {} + +func (m *CurationValue) GetLastCompletionTimestamp() int64 { + if m != nil && m.LastCompletionTimestamp != nil { + return *m.LastCompletionTimestamp + } + return 0 +} + +func init() { +} diff --git a/model/generated/descriptor.blob b/model/generated/descriptor.blob new file mode 100644 index 0000000000000000000000000000000000000000..4c98e380253d379560660d9f17043233a055e3e3 GIT binary patch literal 5071 zcmcIoOLHSv6-JM?q@#!1SN25XWQfxV6VH&ylrk9xXJyOn85OdnSTZ4On(NlJ+)S&x z>Br1CRTTUH7A#mp6&s2r8;TWwAU_277o2;qy4_OCFr+44$@iYuJK$UgBXZw^P`yc0On? zF|`*thFqKWbpe_y&Pff54xMpXx!np`hmuFl=XAc9M(PUiN+EB-`b$Qir!T7F;xW`_EC^7r5ng+&RTQT0WK6$#s4$!S5Gu@xW|Bz} zOxgG9NU_ZL1WEz(Usxt_Ll;zFKb_n z$CY$8L&Go{-3KjSNt;`QSD4Av7%4WBxg zu`)gOGQL}KR9lZLIF!gl#rtR zUV+V(>9QEG2CQKkUoao5EQh7E4~k7Mn2n{9+ii5dpLy0Qne9GjAy1$vs!S2A4_}XU zjCDyipu#x~(G%8?y+Twd3r|m2+!VH;K4F(MvP0tqwIhaA!U@|qj+E(tZ?)pN8@0dX zp(vEDLv{S+P&bYS=ZAe=&5;IxI5_SP4#sLe`M-BMe*8!+V4IQ*=klPKCitYIDrj>} z3h4b*KSGwZ#S^3{kvdca&Ea6sSIdda(fF))`c$nXGM}Ce&W9=_5>E8d=-{cYRuhWD zFUR^wttBG3S*W6(sL)T(Pt*oFw=Oh}j=5P#vA%SKma2)Ak(9EraDWs<>w+TVOrX&} zIMn;bU^wm#P7nI%yX5Rl|NOjnrXQjIQfEW`V2o!4?YB8-u4dyDREeTGXOJIFK#Ji$d9E<&bVd)s4dB zkSnZ^y&Jdi4pQxW_ZHJ*1O8orDn|(O|H&rQenDSQBL)N#A-n^d;uIA!-!N?&1fo~) zimwn2n&Nhby}|NqW^kMmv;Z&5`^qJ?14cfAdxB=l9Ol!I8SIx4UKrGw7*{m7YHg;e zkD=z`yqsBIp)l7M1G3S{=3&b6Hh%$UIKgqbuZ)JeeuO0eQ#W}_HMZ6?4Pgg@nK@ht zT54MV2e5TxZJKH$O@;6FuCtOznx+ezkz+aNHqU2#Q1W*n#Q3Mg7}>FRo~D*j(e|O1 zejTZRd>|TxDgUda{s#Z@+TU}~SR88P zKD-qpw19=iOUoAypHVr~lJK?RUB@+W+Bp;IPY~(F5Z0ikiE|QT#IrJ?e-qD6oBoeH z)WqnM9trrMG{v;z3EJqqpGosHb-T+a&ig1Z6( z`^>~-orvk2JPxaYz4DlE&6pEX+n7<$c+RdxmR7hlj)oW0|4sNq+XF>B1habn6!kl# z48`u?>!G#F5qjr!YC@P|A!SJXcFY`&_=QT%Zx&sXrYPjR;!A}}Q_P%T{I zLhI7PzAb0E92DC?JU6gH>jmFIVo1klMv>s1!=`lUj#o#4&xeVNdmx)j<7hF*PlM36 zoM{Rg*7#mXr&FJcipj;m*!~2{iHV3k`6$6AEr4_$=Lt%)0wV$Xn4S6Evi4W(UW*G6 zHi5G3VuA98D%axOjDHqc+Wk5Gwh86Bc7 zH=6E@SAHP6g4m2hpIY|9758N2@BuWDc-f{ybqP2G&vNjm5;hzf()l-my5;g;9EPwc z*#4g%5wu;X2zWT8mcO*$HzeU@J@H)0d($YvgTcVj8-LX|6FKn4U&>g+