Skip to content

PMM-10512, PMM-10820 Capture usename and application_name for pg_stat_activity, update exporter #77

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

Merged
merged 7 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
PMM-10512 Dump metrics update
  • Loading branch information
tshcherban committed Oct 4, 2022
commit 2d70b095a3ec3ecdba238bce209720bdb75f8baf
3 changes: 2 additions & 1 deletion percona_tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ test-performance:
extraMetrics = false
multipleLabels = false
dumpMetrics = false
endpoint = ''

test-metrics:
go test -v -run '^TestMissingMetrics$$' -args -doRun=true
Expand All @@ -22,7 +23,7 @@ test-resolutions:
go test -v -run '^TestResolutions$$' -args -doRun=true

dump-metrics:
go test -v -run '^TestDumpMetrics$$' -args -doRun=true -extraMetrics=$(extraMetrics) -multipleLabels=$(multipleLabels) -dumpMetrics=$(dumpMetrics)
go test -v -run '^TestDumpMetrics$$' -args -doRun=true -extraMetrics=$(extraMetrics) -multipleLabels=$(multipleLabels) -endpoint=$(endpoint) -dumpMetrics=true

test-consistency: test-metrics test-resolutions test-resolutions-duplicates

Expand Down
18 changes: 16 additions & 2 deletions percona_tests/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
var dumpMetricsFlag = flag.Bool("dumpMetrics", false, "")
var printExtraMetrics = flag.Bool("extraMetrics", false, "")
var printMultipleLabels = flag.Bool("multipleLabels", false, "")
var endpointFlag = flag.String("endpoint", "", "")

type Metric struct {
name string
Expand Down Expand Up @@ -86,13 +87,26 @@ func TestDumpMetrics(t *testing.T) {
return
}

newMetrics, err := getMetrics(updatedExporterFileName)
var ep string
if endpointFlag == nil || *endpointFlag == "" {
ep = "metrics"
} else if *endpointFlag == "hr" {
ep = highResolutionEndpoint
} else if *endpointFlag == "mr" {
ep = medResolutionEndpoint
} else if *endpointFlag == "lr" {
ep = lowResolutionEndpoint
} else {
ep = "metrics"
}

newMetrics, err := getMetricsFrom(updatedExporterFileName, ep)
if err != nil {
t.Error(err)
return
}

oldMetrics, err := getMetrics(oldExporterFileName)
oldMetrics, err := getMetricsFrom(oldExporterFileName, ep)
if err != nil {
t.Error(err)
return
Expand Down