Fix typos in comments, tests, and errors (#1346)

Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
This commit is contained in:
Oleksandr Redko 2023-09-21 14:31:08 +03:00 committed by GitHub
parent df7fa49417
commit bbab8fe770
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 19 additions and 19 deletions

View File

@ -295,7 +295,7 @@ _This release removes all previously deprecated features, resulting in the break
* [BUGFIX] Fixed goroutine leaks. #236 #472 * [BUGFIX] Fixed goroutine leaks. #236 #472
* [BUGFIX] Fixed an error message for exponential histogram buckets. #467 * [BUGFIX] Fixed an error message for exponential histogram buckets. #467
* [BUGFIX] Fixed data race writing to the metric map. #401 * [BUGFIX] Fixed data race writing to the metric map. #401
* [BUGFIX] API client: Decode JSON on a 4xx respons but do not on 204 * [BUGFIX] API client: Decode JSON on a 4xx response but do not on 204
responses. #476 #414 responses. #476 #414
## 0.8.0 / 2016-08-17 ## 0.8.0 / 2016-08-17

View File

@ -1441,7 +1441,7 @@ func TestAPIClientDo(t *testing.T) {
} }
} else { } else {
if warnings != nil { if warnings != nil {
t.Fatalf("unexpexted warnings: %v", warnings) t.Fatalf("unexpected warnings: %v", warnings)
} }
} }

View File

@ -135,7 +135,7 @@ func ExampleAPI_queryRangeWithBasicAuth() {
client, err := api.NewClient(api.Config{ client, err := api.NewClient(api.Config{
Address: "http://demo.robustperception.io:9090", Address: "http://demo.robustperception.io:9090",
// We can use amazing github.com/prometheus/common/config helper! // We can use amazing github.com/prometheus/common/config helper!
RoundTripper: config.NewBasicAuthRoundTripper("me", "defintely_me", "", api.DefaultRoundTripper), RoundTripper: config.NewBasicAuthRoundTripper("me", "definitely_me", "", api.DefaultRoundTripper),
}) })
if err != nil { if err != nil {
fmt.Printf("Error creating client: %v\n", err) fmt.Printf("Error creating client: %v\n", err)

View File

@ -22,7 +22,7 @@ import "github.com/prometheus/client_golang/prometheus"
// Prometheus metrics. Note that the data models of expvar and Prometheus are // Prometheus metrics. Note that the data models of expvar and Prometheus are
// fundamentally different, and that the expvar Collector is inherently slower // fundamentally different, and that the expvar Collector is inherently slower
// than native Prometheus metrics. Thus, the expvar Collector is probably great // than native Prometheus metrics. Thus, the expvar Collector is probably great
// for experiments and prototying, but you should seriously consider a more // for experiments and prototyping, but you should seriously consider a more
// direct implementation of Prometheus metrics for monitoring production // direct implementation of Prometheus metrics for monitoring production
// systems. // systems.
// //

View File

@ -67,7 +67,7 @@ type CounterVecOpts struct {
CounterOpts CounterOpts
// VariableLabels are used to partition the metric vector by the given set // VariableLabels are used to partition the metric vector by the given set
// of labels. Each label value will be constrained with the optional Contraint // of labels. Each label value will be constrained with the optional Constraint
// function, if provided. // function, if provided.
VariableLabels ConstrainableLabels VariableLabels ConstrainableLabels
} }

View File

@ -62,7 +62,7 @@ type GaugeVecOpts struct {
GaugeOpts GaugeOpts
// VariableLabels are used to partition the metric vector by the given set // VariableLabels are used to partition the metric vector by the given set
// of labels. Each label value will be constrained with the optional Contraint // of labels. Each label value will be constrained with the optional Constraint
// function, if provided. // function, if provided.
VariableLabels ConstrainableLabels VariableLabels ConstrainableLabels
} }

View File

@ -120,7 +120,7 @@ func TestGoCollector_ExposedMetrics(t *testing.T) {
name := goMetrics[i].Desc().fqName name := goMetrics[i].Desc().fqName
if _, ok := tcase.expectedFQNameSet[name]; !ok { if _, ok := tcase.expectedFQNameSet[name]; !ok {
t.Errorf("found unpexpected metric %s", name) t.Errorf("found unexpected metric %s", name)
continue continue
} }
} }

View File

@ -392,7 +392,7 @@ type HistogramOpts struct {
// zero, it is replaced by default buckets. The default buckets are // zero, it is replaced by default buckets. The default buckets are
// DefBuckets if no buckets for a native histogram (see below) are used, // DefBuckets if no buckets for a native histogram (see below) are used,
// otherwise the default is no buckets. (In other words, if you want to // otherwise the default is no buckets. (In other words, if you want to
// use both reguler buckets and buckets for a native histogram, you have // use both regular buckets and buckets for a native histogram, you have
// to define the regular buckets here explicitly.) // to define the regular buckets here explicitly.)
Buckets []float64 Buckets []float64
@ -484,7 +484,7 @@ type HistogramVecOpts struct {
HistogramOpts HistogramOpts
// VariableLabels are used to partition the metric vector by the given set // VariableLabels are used to partition the metric vector by the given set
// of labels. Each label value will be constrained with the optional Contraint // of labels. Each label value will be constrained with the optional Constraint
// function, if provided. // function, if provided.
VariableLabels ConstrainableLabels VariableLabels ConstrainableLabels
} }
@ -896,7 +896,7 @@ func (h *histogram) maybeReset(
h.resetCounts(cold) h.resetCounts(cold)
// Repeat the latest observation to not lose it completely. // Repeat the latest observation to not lose it completely.
cold.observe(value, bucket, true) cold.observe(value, bucket, true)
// Make coldCounts the new hot counts while ressetting countAndHotIdx. // Make coldCounts the new hot counts while resetting countAndHotIdx.
n := atomic.SwapUint64(&h.countAndHotIdx, (coldIdx<<63)+1) n := atomic.SwapUint64(&h.countAndHotIdx, (coldIdx<<63)+1)
count := n & ((1 << 63) - 1) count := n & ((1 << 63) - 1)
waitForCooldown(count, hot) waitForCooldown(count, hot)
@ -1356,7 +1356,7 @@ func makeBuckets(buckets *sync.Map) ([]*dto.BucketSpan, []int64) {
// Multiple spans with only small gaps in between are probably // Multiple spans with only small gaps in between are probably
// encoded more efficiently as one larger span with a few empty // encoded more efficiently as one larger span with a few empty
// buckets. Needs some research to find the sweet spot. For now, // buckets. Needs some research to find the sweet spot. For now,
// we assume that gaps of one ore two buckets should not create // we assume that gaps of one or two buckets should not create
// a new span. // a new span.
iDelta := int32(i - nextI) iDelta := int32(i - nextI)
if n == 0 || iDelta > 2 { if n == 0 || iDelta > 2 {

View File

@ -14,7 +14,7 @@
// It provides tools to compare sequences of strings and generate textual diffs. // It provides tools to compare sequences of strings and generate textual diffs.
// //
// Maintaining `GetUnifiedDiffString` here because original repository // Maintaining `GetUnifiedDiffString` here because original repository
// (https://github.com/pmezard/go-difflib) is no loger maintained. // (https://github.com/pmezard/go-difflib) is no longer maintained.
package internal package internal
import ( import (

View File

@ -289,7 +289,7 @@ func (p *Pusher) push(ctx context.Context, method string) error {
} }
if err := enc.Encode(mf); err != nil { if err := enc.Encode(mf); err != nil {
return fmt.Errorf( return fmt.Errorf(
"failed to encode metric familty %s, error is %w", "failed to encode metric family %s, error is %w",
mf.GetName(), err) mf.GetName(), err)
} }
} }

View File

@ -548,7 +548,7 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
goroutineBudget-- goroutineBudget--
runtime.Gosched() runtime.Gosched()
} }
// Once both checkedMetricChan and uncheckdMetricChan are closed // Once both checkedMetricChan and uncheckedMetricChan are closed
// and drained, the contraption above will nil out cmc and umc, // and drained, the contraption above will nil out cmc and umc,
// and then we can leave the collect loop here. // and then we can leave the collect loop here.
if cmc == nil && umc == nil { if cmc == nil && umc == nil {

View File

@ -1104,7 +1104,7 @@ type collidingCollector struct {
a, b, c, d prometheus.Collector a, b, c, d prometheus.Collector
} }
// Describe satisifies part of the prometheus.Collector interface. // Describe satisfies part of the prometheus.Collector interface.
func (m *collidingCollector) Describe(desc chan<- *prometheus.Desc) { func (m *collidingCollector) Describe(desc chan<- *prometheus.Desc) {
m.a.Describe(desc) m.a.Describe(desc)
m.b.Describe(desc) m.b.Describe(desc)
@ -1112,7 +1112,7 @@ func (m *collidingCollector) Describe(desc chan<- *prometheus.Desc) {
m.d.Describe(desc) m.d.Describe(desc)
} }
// Collect satisifies part of the prometheus.Collector interface. // Collect satisfies part of the prometheus.Collector interface.
func (m *collidingCollector) Collect(metric chan<- prometheus.Metric) { func (m *collidingCollector) Collect(metric chan<- prometheus.Metric) {
m.a.Collect(metric) m.a.Collect(metric)
m.b.Collect(metric) m.b.Collect(metric)

View File

@ -158,7 +158,7 @@ type SummaryVecOpts struct {
SummaryOpts SummaryOpts
// VariableLabels are used to partition the metric vector by the given set // VariableLabels are used to partition the metric vector by the given set
// of labels. Each label value will be constrained with the optional Contraint // of labels. Each label value will be constrained with the optional Constraint
// function, if provided. // function, if provided.
VariableLabels ConstrainableLabels VariableLabels ConstrainableLabels
} }

View File

@ -230,7 +230,7 @@ func TestCollectAndCompareHistogram(t *testing.T) {
case *prometheus.HistogramVec: case *prometheus.HistogramVec:
collector.WithLabelValues("test").Observe(input.observation) collector.WithLabelValues("test").Observe(input.observation)
default: default:
t.Fatalf("unsuported collector tested") t.Fatalf("unsupported collector tested")
} }

View File

@ -36,7 +36,7 @@ import (
) )
func TestPlayground(t *testing.T) { func TestPlayground(t *testing.T) {
// NOTE: Only one run at the time will work due to statics ports used. // NOTE: Only one run at the time will work due to static ports used.
e, err := e2e.New(e2e.WithVerbose()) e, err := e2e.New(e2e.WithVerbose())
testutil.Ok(t, err) testutil.Ok(t, err)