mirror of
https://github.com/prometheus-community/windows_exporter
synced 2024-12-27 00:42:06 +00:00
a2c4bf6a2d
Benchmarks will allow for easier identification of slow collectors. Additionally, they increase test coverage of the collectors, with some collectors now reaching 80-95% coverage with this change. Collector benchmarks have been structed so that common functionality is present in `collector/collector_test.go` as is done with non-test functionality in `collector/collector.go`. Test logic that is specific to individual collectors is present in the collector test file (E.G. `collector/process_test.go` for the Process collector). Signed-off-by: Ben Reedy <breed808@breed808.com>
29 lines
688 B
Makefile
29 lines
688 B
Makefile
export GOOS=windows
|
|
|
|
.PHONY: build
|
|
build: windows_exporter.exe
|
|
windows_exporter.exe: **/*.go
|
|
promu build -v
|
|
|
|
test:
|
|
go test -v ./...
|
|
|
|
bench:
|
|
go test -v -bench='benchmark(cpu|logicaldisk|logon|memory|net|process|service|system|tcp|time)collector' ./...
|
|
|
|
lint:
|
|
golangci-lint -c .golangci.yaml run
|
|
|
|
.PHONY: e2e-test
|
|
e2e-test: windows_exporter.exe
|
|
powershell -NonInteractive -ExecutionPolicy Bypass -File .\tools\end-to-end-test.ps1
|
|
|
|
fmt:
|
|
gofmt -l -w -s .
|
|
|
|
crossbuild:
|
|
# The prometheus/golang-builder image for promu crossbuild doesn't exist
|
|
# on Windows, so for now, we'll just build twice
|
|
GOARCH=amd64 promu build --prefix=output/amd64
|
|
GOARCH=386 promu build --prefix=output/386
|