textparse

package
v2.0.0-beta.5+incompat... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package textparse contains an efficient parser for the Prometheus text format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser parses samples from a byte slice of samples in the official Prometheus text exposition format.

func New

func New(b []byte) *Parser

New returns a new parser of the byte slice.

func (*Parser) At

func (p *Parser) At() ([]byte, *int64, float64)

At returns the bytes of the metric, the timestamp if set, and the value of the current sample.

func (*Parser) Err

func (p *Parser) Err() error

Err returns the current error.

func (*Parser) Metric

func (p *Parser) Metric(l *labels.Labels) string

Metric writes the labels of the current sample into the passed labels. It returns the string from which the metric was parsed.

func (*Parser) Next

func (p *Parser) Next() bool

Next advances the parser to the next sample. It returns false if no more samples were read or an error occurred.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL