MCPcopy Index your code
hub / github.com/prometheus/client_python / test_roundtrip

Method test_roundtrip

tests/openmetrics/test_parser.py:657–726  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

655
656
657 def test_roundtrip(self):
658 text = """# HELP go_gc_duration_seconds A summary of the GC invocation durations.
659# TYPE go_gc_duration_seconds summary
660go_gc_duration_seconds{quantile="0.0"} 0.013300656000000001
661go_gc_duration_seconds{quantile="0.25"} 0.013638736
662go_gc_duration_seconds{quantile="0.5"} 0.013759906
663go_gc_duration_seconds{quantile="0.75"} 0.013962066
664go_gc_duration_seconds{quantile="1.0"} 0.021383540000000003
665go_gc_duration_seconds_sum 56.12904785
666go_gc_duration_seconds_count 7476.0
667# HELP go_goroutines Number of goroutines that currently exist.
668# TYPE go_goroutines gauge
669go_goroutines 166.0
670# HELP prometheus_local_storage_indexing_batch_duration_milliseconds Quantiles for batch indexing duration in milliseconds.
671# TYPE prometheus_local_storage_indexing_batch_duration_milliseconds summary
672prometheus_local_storage_indexing_batch_duration_milliseconds{quantile="0.5"} NaN
673prometheus_local_storage_indexing_batch_duration_milliseconds{quantile="0.9"} NaN
674prometheus_local_storage_indexing_batch_duration_milliseconds{quantile="0.99"} NaN
675prometheus_local_storage_indexing_batch_duration_milliseconds_sum 871.5665949999999
676prometheus_local_storage_indexing_batch_duration_milliseconds_count 229.0
677# HELP process_cpu_seconds Total user and system CPU time spent in seconds.
678# TYPE process_cpu_seconds counter
679process_cpu_seconds_total 29323.4
680# HELP process_virtual_memory_bytes Virtual memory size in bytes.
681# TYPE process_virtual_memory_bytes gauge
682process_virtual_memory_bytes 2.478268416e+09
683# HELP prometheus_build_info A metric with a constant '1' value labeled by version, revision, and branch from which Prometheus was built.
684# TYPE prometheus_build_info gauge
685prometheus_build_info{branch="HEAD",revision="ef176e5",version="0.16.0rc1"} 1.0
686# HELP prometheus_local_storage_chunk_ops The total number of chunk operations by their type.
687# TYPE prometheus_local_storage_chunk_ops counter
688prometheus_local_storage_chunk_ops_total{type="clone"} 28.0
689prometheus_local_storage_chunk_ops_total{type="create"} 997844.0
690prometheus_local_storage_chunk_ops_total{type="drop"} 1.345758e+06
691prometheus_local_storage_chunk_ops_total{type="load"} 1641.0
692prometheus_local_storage_chunk_ops_total{type="persist"} 981408.0
693prometheus_local_storage_chunk_ops_total{type="pin"} 32662.0
694prometheus_local_storage_chunk_ops_total{type="transcode"} 980180.0
695prometheus_local_storage_chunk_ops_total{type="unpin"} 32662.0
696# HELP foo histogram Testing histogram buckets
697# TYPE foo histogram
698foo_bucket{le="0.0"} 0.0
699foo_bucket{le="1e-05"} 0.0
700foo_bucket{le="0.0001"} 0.0
701foo_bucket{le="0.1"} 8.0
702foo_bucket{le="1.0"} 10.0
703foo_bucket{le="10.0"} 17.0
704foo_bucket{le="100000.0"} 17.0
705foo_bucket{le="1e+06"} 17.0
706foo_bucket{le="1.55555555555552e+06"} 17.0
707foo_bucket{le="1e+23"} 17.0
708foo_bucket{le="+Inf"} 17.0
709foo_count 17.0
710foo_sum 324789.3
711foo_created 1.520430000123e+09
712# HELP bar histogram Testing with labels
713# TYPE bar histogram
714bar_bucket{a="b",le="+Inf"} 0.0

Callers

nothing calls this directly

Calls 5

registerMethod · 0.95
generate_latestFunction · 0.90
CollectorRegistryClass · 0.85
TextCollectorClass · 0.70

Tested by

no test coverage detected