Skip to content

Commit

Permalink
docs: follow-up for 70eaa06
Browse files Browse the repository at this point in the history
Signed-off-by: hagen1778 <roman@victoriametrics.com>
  • Loading branch information
hagen1778 committed Mar 25, 2024
1 parent 70eaa06 commit bc79f71
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions app/vmselect/searchutils/searchutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"reflect"
"strconv"
"testing"
"time"

"github.com/VictoriaMetrics/VictoriaMetrics/lib/storage"
)
Expand Down Expand Up @@ -254,3 +255,28 @@ func tagFiltersToString(tfs []storage.TagFilter) string {
b = append(b, '}')
return string(b)
}

func TestGetDeadline(t *testing.T) {
f := func(got, exp Deadline) {
if got.Deadline() != exp.Deadline() {
t.Fatalf("expected to have %v; got %v instead", exp, got)
}
}

start := time.Now()
expDeadline := func(deadline time.Duration) Deadline {
return NewDeadline(start, deadline, "")
}

r, _ := http.NewRequest("GET", "", nil)
f(GetDeadlineForExport(r, start), expDeadline(*maxExportDuration))
f(GetDeadlineForLabelsAPI(r, start), expDeadline(*maxLabelsAPIDuration))
f(GetDeadlineForStatusRequest(r, start), expDeadline(*maxStatusRequestDuration))
f(GetDeadlineForQuery(r, start), expDeadline(*maxQueryDuration))

r, _ = http.NewRequest("GET", "http://foo?timeout=1s", nil)
f(GetDeadlineForExport(r, start), expDeadline(time.Second))
f(GetDeadlineForLabelsAPI(r, start), expDeadline(time.Second))
f(GetDeadlineForStatusRequest(r, start), expDeadline(time.Second))
f(GetDeadlineForQuery(r, start), expDeadline(time.Second))
}
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/).
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): properly set `Host` header in requests to scrape targets when [`server_name` option at `tls_config`](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#tls_config) is set. Previously the `Host` header was set incorrectly to the target hostname in this case.
* BUGFIX: do not drop `match[]` filter at [`/api/v1/series`](https://docs.victoriametrics.com/url-examples/#apiv1series) if `-search.ignoreExtraFiltersAtLabelsAPI` command-line flag is set, since missing `match[]` filter breaks `/api/v1/series` requests.
* BUGFIX: [vmctl](https://docs.victoriametrics.com/vmctl.html): properly parse TLS key and CA files for [InfluxDB](https://docs.victoriametrics.com/vmctl/#migrating-data-from-influxdb-1x) and [OpenTSDB](https://docs.victoriametrics.com/vmctl/#migrating-data-from-opentsdb) migration modes.

* BUGFIX: [vmui](https://docs.victoriametrics.com/#vmui): fix VictoriaLogs UI query handling to correctly apply `_time` filter across all queries. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5920).
* BUGFIX: [Single-node VictoriaMetrics](https://docs.victoriametrics.com/) and `vmselect` in [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/): limit duration of requests to /api/v1/labels, /api/v1/label/.../values or /api/v1/series with `-search.maxLabelsAPIDuration` duration. Before, `-search.maxExportDuration` value was used by mistake. Thanks to @kbweave for the [pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5992).

## [v1.99.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.99.0)

Expand Down

0 comments on commit bc79f71

Please sign in to comment.