This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ( | |
| "testing" | |
| ) | |
| func BenchmarkPrometheusCounter(b *testing.B) { | |
| promCounter := PromRequestsCounter.WithLabelValues("200") | |
| for i := 0; i < b.N; i++ { | |
| promCounter.Inc() | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "os" | |
| "time" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/app/vmalert/rule/alerting.go b/app/vmalert/rule/alerting.go | |
| index 07ccce0e4c..2a9695bbfc 100644 | |
| --- a/app/vmalert/rule/alerting.go | |
| +++ b/app/vmalert/rule/alerting.go | |
| @@ -425,17 +425,36 @@ func (ar *AlertingRule) exec(ctx context.Context, ts time.Time, limit int) ([]pr | |
| // template labels and annotations before updating ar.alerts, | |
| // since they could use `query` function which takes a while to execute, | |
| // see https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6079. | |
| - expandedLabels := make([]*labelSet, len(res.Data)) | |
| - expandedAnnotations := make([]map[string]string, len(res.Data)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ============================================================================== | |
| # Elasticsearch to VictoriaLogs Migration Script (Parallel Time-Range) | |
| # | |
| # Description: | |
| # This script parallelizes the migration by splitting the total time range | |
| # into smaller chunks. It then launches a dedicated, independent worker process | |
| # for each time chunk. Each worker fetches and sends all data for its | |
| # assigned time range. This is highly effective if the bottleneck is fetching |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "go.opentelemetry.io/otel/attribute" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| "time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func BenchmarkParsePrometheusResponse(b *testing.B) { | |
| data, err := os.ReadFile("testdata/instant_response.json") | |
| if err != nil { | |
| b.Fatalf("error while reading file: %s", err) | |
| } | |
| runWithMem := func(name string, f func(b *testing.B)) { | |
| var m1, m2 runtime.MemStats | |
| runtime.GC() | |
| runtime.ReadMemStats(&m1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md | |
| index 22284b655..34aa04f85 100644 | |
| --- a/docs/CHANGELOG.md | |
| +++ b/docs/CHANGELOG.md | |
| @@ -32,7 +32,7 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/). | |
| **Update note 1: the `--vm-disable-progress-bar` command-line flag at `vmctl` was deprecated. Use `--disable-progress-bar` instead.** | |
| -* FEATURE: all VictoriaMetrics components: use constant-time comparison for comparing HTTP basic auth credentials and auth keys. This should prevent timing attacks when comparing these credentials. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6392) for details. | |
| +* FEATURE: all VictoriaMetrics components: use constant-time comparison for comparing HTTP basic auth credentials and auth keys. This should prevent timing attacks when comparing these credentials. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6392) for details. Thanks to @wasim-nihal for [the pull request](https://github.com/VictoriaMe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| index c285f05e3..affb717e5 100644 | |
| --- a/scrape/scrape.go | |
| +++ b/scrape/scrape.go | |
| @@ -1241,7 +1241,7 @@ mainLoop: | |
| } | |
| last = sl.scrapeAndReport(last, scrapeTime, errc) | |
| - | |
| + fmt.Println("scrape timestamp", scrapeTime.UnixMilli(), "actual timestamp:", time.Now()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/app/vmctl/main.go b/app/vmctl/main.go | |
| index 95743081f..151e9115b 100644 | |
| --- a/app/vmctl/main.go | |
| +++ b/app/vmctl/main.go | |
| @@ -230,7 +230,7 @@ func main() { | |
| if err != nil { | |
| return fmt.Errorf("error initilize auth config for destination: %s", dstAddr) | |
| } | |
| - dstHTTPClient := &http.Client{Transport: &http.Transport{DisableKeepAlives: disableKeepAlive}} | |
| + dstHTTPClient := &http.Client{Transport: &http.Transport{DisableKeepAlives: disableKeepAlive, ResponseHeaderTimeout: time.Second * 60}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/app/vmctl/vm_native.go | |
| +++ b/app/vmctl/vm_native.go | |
| @@ -5,8 +5,11 @@ import ( | |
| "fmt" | |
| "io" | |
| "log" | |
| + "net/http/httptrace" | |
| + "sort" | |
| "strings" | |
| "sync" |
NewerOlder