Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in comments, tests, and errors #1346

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ _This release removes all previously deprecated features, resulting in the break
* [BUGFIX] Fixed goroutine leaks. #236 #472
* [BUGFIX] Fixed an error message for exponential histogram buckets. #467
* [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

## 0.8.0 / 2016-08-17
Expand Down
2 changes: 1 addition & 1 deletion api/prometheus/v1/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ func TestAPIClientDo(t *testing.T) {
}
} else {
if warnings != nil {
t.Fatalf("unexpexted warnings: %v", warnings)
t.Fatalf("unexpected warnings: %v", warnings)
}
}

Expand Down
2 changes: 1 addition & 1 deletion api/prometheus/v1/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func ExampleAPI_queryRangeWithBasicAuth() {
client, err := api.NewClient(api.Config{
Address: "http://demo.robustperception.io:9090",
// 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 {
fmt.Printf("Error creating client: %v\n", err)
Expand Down
2 changes: 1 addition & 1 deletion prometheus/collectors/expvar_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import "github.com/prometheus/client_golang/prometheus"
// Prometheus metrics. Note that the data models of expvar and Prometheus are
// fundamentally different, and that the expvar Collector is inherently slower
// 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
// systems.
//
Expand Down
2 changes: 1 addition & 1 deletion prometheus/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type CounterVecOpts struct {
CounterOpts

// 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.
VariableLabels ConstrainableLabels
}
Expand Down
2 changes: 1 addition & 1 deletion prometheus/gauge.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type GaugeVecOpts struct {
GaugeOpts

// 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.
VariableLabels ConstrainableLabels
}
Expand Down
2 changes: 1 addition & 1 deletion prometheus/go_collector_latest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func TestGoCollector_ExposedMetrics(t *testing.T) {
name := goMetrics[i].Desc().fqName

if _, ok := tcase.expectedFQNameSet[name]; !ok {
t.Errorf("found unpexpected metric %s", name)
t.Errorf("found unexpected metric %s", name)
continue
}
}
Expand Down
8 changes: 4 additions & 4 deletions prometheus/histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ type HistogramOpts struct {
// zero, it is replaced by default buckets. The default buckets are
// 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
// 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.)
Buckets []float64

Expand Down Expand Up @@ -484,7 +484,7 @@ type HistogramVecOpts struct {
HistogramOpts

// 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.
VariableLabels ConstrainableLabels
}
Expand Down Expand Up @@ -896,7 +896,7 @@ func (h *histogram) maybeReset(
h.resetCounts(cold)
// Repeat the latest observation to not lose it completely.
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)
count := n & ((1 << 63) - 1)
waitForCooldown(count, hot)
Expand Down Expand Up @@ -1356,7 +1356,7 @@ func makeBuckets(buckets *sync.Map) ([]*dto.BucketSpan, []int64) {
// Multiple spans with only small gaps in between are probably
// encoded more efficiently as one larger span with a few empty
// 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.
iDelta := int32(i - nextI)
if n == 0 || iDelta > 2 {
Expand Down
2 changes: 1 addition & 1 deletion prometheus/internal/difflib.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// It provides tools to compare sequences of strings and generate textual diffs.
//
// 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

import (
Expand Down
2 changes: 1 addition & 1 deletion prometheus/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (p *Pusher) push(ctx context.Context, method string) error {
}
if err := enc.Encode(mf); err != nil {
return fmt.Errorf(
"failed to encode metric familty %s, error is %w",
"failed to encode metric family %s, error is %w",
mf.GetName(), err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion prometheus/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
goroutineBudget--
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 then we can leave the collect loop here.
if cmc == nil && umc == nil {
Expand Down
4 changes: 2 additions & 2 deletions prometheus/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1104,15 +1104,15 @@ type collidingCollector struct {
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) {
m.a.Describe(desc)
m.b.Describe(desc)
m.c.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) {
m.a.Collect(metric)
m.b.Collect(metric)
Expand Down
2 changes: 1 addition & 1 deletion prometheus/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ type SummaryVecOpts struct {
SummaryOpts

// 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.
VariableLabels ConstrainableLabels
}
Expand Down
2 changes: 1 addition & 1 deletion prometheus/testutil/testutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func TestCollectAndCompareHistogram(t *testing.T) {
case *prometheus.HistogramVec:
collector.WithLabelValues("test").Observe(input.observation)
default:
t.Fatalf("unsuported collector tested")
t.Fatalf("unsupported collector tested")

}

Expand Down
2 changes: 1 addition & 1 deletion tutorial/whatsup/internal/playground_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
)

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())
testutil.Ok(t, err)
Expand Down
Loading