Commit Graph

9 Commits

Author SHA1 Message Date
Bjoern Rabenstein 29347ab2a9 Add a few trailing commas to tests.
That is to prove that trailing commas work for the processor.

Change-Id: Ibecac811d47958387c9633df69bafbe284cf0b8f
2014-12-05 14:23:03 +01:00
Bjoern Rabenstein 5d40912fd2 Complete rewrite of the exposition library.
This rewrite had may backs and forths. In my git repository, it
consists of 35 commits which I cannot group or merge into reasonable
review buckets. Gerrit breaks fundamental git semantics, so I have to
squash the 35 commits into one for the review.

I'll push this not with refs/for/master, but with refs/for/next so
that we can transition after submission in a controlled fashion.

For the review, I recommend to start with looking at godoc and in
particular the many examples. After that, continue with a line-by-line
detailed review. (The big picture is hopefully as expected after
wrapping up the discussion earlier.)

Change-Id: Ib38cc46493a5139ca29d84020650929d94cac850
2014-06-17 14:08:22 +02:00
Bjoern Rabenstein d3ebb29141 Fix escaping even more.
Change-Id: Ie958d557aae0dda68c451e9fafc615221cc07bb0
2014-05-15 12:49:39 +02:00
Bjoern Rabenstein 82e55cd560 Fix docstring escaping.
Change-Id: Ib8c8658795c9e2b0fa1a9321d7cbdef7ad4f2745
2014-05-14 18:46:58 +02:00
Bjoern Rabenstein 44926efd85 Fix typo.
Change-Id: I1b28a0f232e88b79bc34a458c115bcf74e978284
2014-05-14 14:51:12 +02:00
Bjoern Rabenstein 3dfae09d30 Fix things commented on in past code review.
Change-Id: I4dafd098eefa99bc37fdbfebeb4c61a7251ad0be
2014-04-29 13:37:49 +02:00
Bjoern Rabenstein 84dc53148d Enable the Golang client library to create the new text formats.
Most important here is the simple & flat text format, but while I'm on
it, I have also added the text representations for protobufs (which is
purely meant for debugging purposes). I hope my basic idea about
handling those various protocols (and the text package) becomes
clearer now.

Change-Id: I7299853eadc82a426101e907f2b3d4e37f9e4c71
2014-04-25 21:45:04 +02:00
Bjoern Rabenstein e5dc0421cd Move signature.go and related tests to the model package.
The LabelsToSignature function is now used outside of the prometheus
package, too. Leaving it in the prometheuos package is misleading
design and will lead to circulat import chains soon.

Change-Id: If1ca442d4023b33b138cf79fee68e82ff2a355be
2014-04-25 20:48:16 +02:00
Bjoern Rabenstein ecac33bed0 Conversion back and forth between MetricFamily protobuf and text format.
The idea here is to always go via the protobufs if dealing with the
text format. That won't always be the most efficient way, but it
avoids the multiplicity of conversion routines required for direct
conversion (e.g. text format -> internal representation in the
Prometheus server). The loss of efficiency is acceptable because the
text format should not be used in high performance (high throughput,
low latency) situations anyway.

In that way, the text format stays perfectly isolated from other parts
of the code. To receive text format, just plug the conversion in
before the code path that normally reads protobufs. Correspondingly,
for sending text format, simply replace the WriteDelimited call by a
text.Create call.

Nevertheless, the conversion code itself is optimized for efficiency
and minimized memory churn (which was one of the reason for handcoding
the parser and not using a lexer/parser code generation tool).

Change-Id: Iee45ffe8aa421a844225d13a1f859becd8a3b066
2014-04-17 16:28:13 +02:00