Skip to content

Commit bbab8fe

Browse files
authored
Fix typos in comments, tests, and errors (#1346)
Signed-off-by: Oleksandr Redko <[email protected]>
1 parent df7fa49 commit bbab8fe

File tree

15 files changed

+19
-19
lines changed

15 files changed

+19
-19
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ _This release removes all previously deprecated features, resulting in the break
295295
* [BUGFIX] Fixed goroutine leaks. #236 #472
296296
* [BUGFIX] Fixed an error message for exponential histogram buckets. #467
297297
* [BUGFIX] Fixed data race writing to the metric map. #401
298-
* [BUGFIX] API client: Decode JSON on a 4xx respons but do not on 204
298+
* [BUGFIX] API client: Decode JSON on a 4xx response but do not on 204
299299
responses. #476 #414
300300

301301
## 0.8.0 / 2016-08-17

api/prometheus/v1/api_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ func TestAPIClientDo(t *testing.T) {
14411441
}
14421442
} else {
14431443
if warnings != nil {
1444-
t.Fatalf("unexpexted warnings: %v", warnings)
1444+
t.Fatalf("unexpected warnings: %v", warnings)
14451445
}
14461446
}
14471447

api/prometheus/v1/example_test.go

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

prometheus/collectors/expvar_collector.go

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

prometheus/counter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type CounterVecOpts struct {
6767
CounterOpts
6868

6969
// VariableLabels are used to partition the metric vector by the given set
70-
// of labels. Each label value will be constrained with the optional Contraint
70+
// of labels. Each label value will be constrained with the optional Constraint
7171
// function, if provided.
7272
VariableLabels ConstrainableLabels
7373
}

prometheus/gauge.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type GaugeVecOpts struct {
6262
GaugeOpts
6363

6464
// VariableLabels are used to partition the metric vector by the given set
65-
// of labels. Each label value will be constrained with the optional Contraint
65+
// of labels. Each label value will be constrained with the optional Constraint
6666
// function, if provided.
6767
VariableLabels ConstrainableLabels
6868
}

prometheus/go_collector_latest_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func TestGoCollector_ExposedMetrics(t *testing.T) {
120120
name := goMetrics[i].Desc().fqName
121121

122122
if _, ok := tcase.expectedFQNameSet[name]; !ok {
123-
t.Errorf("found unpexpected metric %s", name)
123+
t.Errorf("found unexpected metric %s", name)
124124
continue
125125
}
126126
}

prometheus/histogram.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ type HistogramOpts struct {
392392
// zero, it is replaced by default buckets. The default buckets are
393393
// DefBuckets if no buckets for a native histogram (see below) are used,
394394
// otherwise the default is no buckets. (In other words, if you want to
395-
// use both reguler buckets and buckets for a native histogram, you have
395+
// use both regular buckets and buckets for a native histogram, you have
396396
// to define the regular buckets here explicitly.)
397397
Buckets []float64
398398

@@ -484,7 +484,7 @@ type HistogramVecOpts struct {
484484
HistogramOpts
485485

486486
// VariableLabels are used to partition the metric vector by the given set
487-
// of labels. Each label value will be constrained with the optional Contraint
487+
// of labels. Each label value will be constrained with the optional Constraint
488488
// function, if provided.
489489
VariableLabels ConstrainableLabels
490490
}
@@ -896,7 +896,7 @@ func (h *histogram) maybeReset(
896896
h.resetCounts(cold)
897897
// Repeat the latest observation to not lose it completely.
898898
cold.observe(value, bucket, true)
899-
// Make coldCounts the new hot counts while ressetting countAndHotIdx.
899+
// Make coldCounts the new hot counts while resetting countAndHotIdx.
900900
n := atomic.SwapUint64(&h.countAndHotIdx, (coldIdx<<63)+1)
901901
count := n & ((1 << 63) - 1)
902902
waitForCooldown(count, hot)
@@ -1356,7 +1356,7 @@ func makeBuckets(buckets *sync.Map) ([]*dto.BucketSpan, []int64) {
13561356
// Multiple spans with only small gaps in between are probably
13571357
// encoded more efficiently as one larger span with a few empty
13581358
// buckets. Needs some research to find the sweet spot. For now,
1359-
// we assume that gaps of one ore two buckets should not create
1359+
// we assume that gaps of one or two buckets should not create
13601360
// a new span.
13611361
iDelta := int32(i - nextI)
13621362
if n == 0 || iDelta > 2 {

prometheus/internal/difflib.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// It provides tools to compare sequences of strings and generate textual diffs.
1515
//
1616
// Maintaining `GetUnifiedDiffString` here because original repository
17-
// (https://github.com/pmezard/go-difflib) is no loger maintained.
17+
// (https://github.com/pmezard/go-difflib) is no longer maintained.
1818
package internal
1919

2020
import (

prometheus/push/push.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func (p *Pusher) push(ctx context.Context, method string) error {
289289
}
290290
if err := enc.Encode(mf); err != nil {
291291
return fmt.Errorf(
292-
"failed to encode metric familty %s, error is %w",
292+
"failed to encode metric family %s, error is %w",
293293
mf.GetName(), err)
294294
}
295295
}

prometheus/registry.go

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

prometheus/registry_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1104,15 +1104,15 @@ type collidingCollector struct {
11041104
a, b, c, d prometheus.Collector
11051105
}
11061106

1107-
// Describe satisifies part of the prometheus.Collector interface.
1107+
// Describe satisfies part of the prometheus.Collector interface.
11081108
func (m *collidingCollector) Describe(desc chan<- *prometheus.Desc) {
11091109
m.a.Describe(desc)
11101110
m.b.Describe(desc)
11111111
m.c.Describe(desc)
11121112
m.d.Describe(desc)
11131113
}
11141114

1115-
// Collect satisifies part of the prometheus.Collector interface.
1115+
// Collect satisfies part of the prometheus.Collector interface.
11161116
func (m *collidingCollector) Collect(metric chan<- prometheus.Metric) {
11171117
m.a.Collect(metric)
11181118
m.b.Collect(metric)

prometheus/summary.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ type SummaryVecOpts struct {
158158
SummaryOpts
159159

160160
// VariableLabels are used to partition the metric vector by the given set
161-
// of labels. Each label value will be constrained with the optional Contraint
161+
// of labels. Each label value will be constrained with the optional Constraint
162162
// function, if provided.
163163
VariableLabels ConstrainableLabels
164164
}

prometheus/testutil/testutil_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func TestCollectAndCompareHistogram(t *testing.T) {
230230
case *prometheus.HistogramVec:
231231
collector.WithLabelValues("test").Observe(input.observation)
232232
default:
233-
t.Fatalf("unsuported collector tested")
233+
t.Fatalf("unsupported collector tested")
234234

235235
}
236236

tutorial/whatsup/internal/playground_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636
)
3737

3838
func TestPlayground(t *testing.T) {
39-
// NOTE: Only one run at the time will work due to statics ports used.
39+
// NOTE: Only one run at the time will work due to static ports used.
4040

4141
e, err := e2e.New(e2e.WithVerbose())
4242
testutil.Ok(t, err)

0 commit comments

Comments
 (0)