forked from mirror/client_golang
ecac33bed0
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 |
||
---|---|---|
.. | ||
exp | ||
.gitignore | ||
Makefile | ||
accumulating_bucket.go | ||
accumulating_bucket_test.go | ||
bucket.go | ||
constants.go | ||
counter.go | ||
counter_test.go | ||
distributions.go | ||
documentation.go | ||
eviction.go | ||
eviction_test.go | ||
gauge.go | ||
gauge_test.go | ||
helpers_test.go | ||
histogram.go | ||
histogram_test.go | ||
interface.go | ||
metric.go | ||
priority_queue.go | ||
priority_queue_test.go | ||
prometheus_test.go | ||
registry.go | ||
registry_test.go | ||
signature.go | ||
signature_test.go | ||
statistics.go | ||
statistics_test.go | ||
tallying_bucket.go | ||
tallying_bucket_test.go | ||
telemetry.go |