mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-11 13:57:36 -08:00
Fix exported function comments (#6002)
Signed-off-by: zhulongcheng <zhulongcheng.dev@gmail.com>
This commit is contained in:
parent
3b3eaf3496
commit
970ef41bb6
|
@ -20,7 +20,7 @@ type Gate struct {
|
||||||
ch chan struct{}
|
ch chan struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewGate returns a query gate that limits the number of queries
|
// New returns a query gate that limits the number of queries
|
||||||
// being concurrently executed.
|
// being concurrently executed.
|
||||||
func New(length int) *Gate {
|
func New(length int) *Gate {
|
||||||
return &Gate{
|
return &Gate{
|
||||||
|
|
|
@ -87,7 +87,7 @@ type OpenMetricsParser struct {
|
||||||
offsets []int
|
offsets []int
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new parser of the byte slice.
|
// NewOpenMetricsParser returns a new parser of the byte slice.
|
||||||
func NewOpenMetricsParser(b []byte) Parser {
|
func NewOpenMetricsParser(b []byte) Parser {
|
||||||
return &OpenMetricsParser{l: &openMetricsLexer{b: b}}
|
return &OpenMetricsParser{l: &openMetricsLexer{b: b}}
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ type PromParser struct {
|
||||||
offsets []int
|
offsets []int
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new parser of the byte slice.
|
// NewPromParser returns a new parser of the byte slice.
|
||||||
func NewPromParser(b []byte) Parser {
|
func NewPromParser(b []byte) Parser {
|
||||||
return &PromParser{l: &promlexer{b: append(b, '\n')}}
|
return &PromParser{l: &promlexer{b: append(b, '\n')}}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ var corsHeaders = map[string]string{
|
||||||
"Vary": "Origin",
|
"Vary": "Origin",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enables cross-site script calls.
|
// SetCORS enables cross-site script calls.
|
||||||
func SetCORS(w http.ResponseWriter, o *regexp.Regexp, r *http.Request) {
|
func SetCORS(w http.ResponseWriter, o *regexp.Regexp, r *http.Request) {
|
||||||
origin := r.Header.Get("Origin")
|
origin := r.Header.Get("Origin")
|
||||||
if origin == "" {
|
if origin == "" {
|
||||||
|
|
|
@ -54,7 +54,7 @@ func (s QueryTiming) String() string {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return a string representation of a QueryTiming span operation.
|
// SpanOperation returns a string representation of a QueryTiming span operation.
|
||||||
func (s QueryTiming) SpanOperation() string {
|
func (s QueryTiming) SpanOperation() string {
|
||||||
switch s {
|
switch s {
|
||||||
case EvalTotalTime:
|
case EvalTotalTime:
|
||||||
|
|
Loading…
Reference in a new issue