From 73e0b67aeef1d9e3e85214ca1d58aa1a4c3bc65f Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Mon, 29 Jan 2018 12:15:29 -0600 Subject: [PATCH 1/3] Link to usage question issue --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e28a6f7cd..999e4c081 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ - [Get Support](#get-support) - [Contributing](#contributing) +Are you using Pilosa? [Let us know](https://github.com/pilosa/pilosa/issues/1074)! ## Docs From 8625c2fcdb20283e88dbc36a3084c9b66b557158 Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Mon, 29 Jan 2018 13:44:43 -0600 Subject: [PATCH 2/3] Update wording --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 999e4c081..5ae041dfd 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ - [Get Support](#get-support) - [Contributing](#contributing) -Are you using Pilosa? [Let us know](https://github.com/pilosa/pilosa/issues/1074)! +Want to contribute? One of the easiest ways is to [tell us how you're using (or want to use) Pilosa](https://github.com/pilosa/pilosa/issues/1074). We learn from every discussion! ## Docs From 6756d97089bd4ba80b5299df0af2c6c068e7c4a5 Mon Sep 17 00:00:00 2001 From: Cody Soyland Date: Fri, 2 Feb 2018 17:32:14 -0600 Subject: [PATCH 3/3] Enable diagnostics via build constraint to prevent from running in tests --- Dockerfile | 2 +- Makefile | 4 ++-- server/default.go | 10 ++++++++++ server/release.go | 10 ++++++++++ server/server.go | 3 --- server/server_test.go | 1 - test/pilosa.go | 2 -- 7 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 server/default.go create mode 100644 server/release.go diff --git a/Dockerfile b/Dockerfile index b145465b6..6d86de974 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY . /go/src/github.com/pilosa/pilosa RUN cd /go/src/github.com/pilosa/pilosa \ && make vendor \ - && CGO_ENABLED=0 go install -a -ldflags "$ldflags" github.com/pilosa/pilosa/cmd/pilosa + && CGO_ENABLED=0 go install -tags release -a -ldflags "$ldflags" github.com/pilosa/pilosa/cmd/pilosa FROM scratch diff --git a/Makefile b/Makefile index e1ed7c5d5..48c0075a8 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ cover-viz: cover go tool cover -html=build/coverage/all.out pilosa: vendor - go build -ldflags $(LDFLAGS) $(FLAGS) $(CLONE_URL)/cmd/pilosa + go build -tags release -ldflags $(LDFLAGS) $(FLAGS) $(CLONE_URL)/cmd/pilosa release-build: vendor ifdef DOCKER_BUILD @@ -114,7 +114,7 @@ docker: @echo "Created image: pilosa:$(VERSION)" docker-build: - docker run --rm -v $(PWD):/go/src/$(CLONE_URL) -w /go/src/$(CLONE_URL) -e GOOS=$(GOOS) -e GOARCH=$(GOARCH) $(DOCKER_GOLANG_IMAGE) go build -ldflags $(LDFLAGS) $(FLAGS) $(CLONE_URL)/cmd/pilosa + docker run --rm -v $(PWD):/go/src/$(CLONE_URL) -w /go/src/$(CLONE_URL) -e GOOS=$(GOOS) -e GOARCH=$(GOARCH) $(DOCKER_GOLANG_IMAGE) go build -tags release -ldflags $(LDFLAGS) $(FLAGS) $(CLONE_URL)/cmd/pilosa docker-test: docker run --rm -v $(PWD):/go/src/$(CLONE_URL) -w /go/src/$(CLONE_URL) $(DOCKER_GOLANG_IMAGE) go test $(TESTFLAGS) $(PKGS) diff --git a/server/default.go b/server/default.go new file mode 100644 index 000000000..6e9726afe --- /dev/null +++ b/server/default.go @@ -0,0 +1,10 @@ +// +build !release +// +// This file sets defaults to be overridden by release.go + +package server + +import "time" + +// DefaultDiagnosticsInterval is the default sync frequency diagnostic metrics. A value of 0 disables diagnostics. +const DefaultDiagnosticsInterval = time.Duration(0) diff --git a/server/release.go b/server/release.go new file mode 100644 index 000000000..de5b4a4d0 --- /dev/null +++ b/server/release.go @@ -0,0 +1,10 @@ +// +build release +// +// This file sets release-specific variables. + +package server + +import "time" + +// DefaultDiagnosticsInterval is the default sync frequency diagnostic metrics. +const DefaultDiagnosticsInterval = 1 * time.Hour diff --git a/server/server.go b/server/server.go index 22bfc592a..115f77263 100644 --- a/server/server.go +++ b/server/server.go @@ -45,9 +45,6 @@ func init() { const ( // DefaultDataDir is the default data directory. DefaultDataDir = "~/.pilosa" - - // DefaultDiagnosticsInterval is the default sync frequency diagnostic metrics. - DefaultDiagnosticsInterval = 1 * time.Hour ) // Command represents the state of the pilosa server command. diff --git a/server/server_test.go b/server/server_test.go index a1bcc305c..4281541da 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -539,7 +539,6 @@ func NewMainArrayWithCluster(size int) []*Main { // MustRunMain returns a new, running Main. Panic on error. func MustRunMain() *Main { m := NewMain() - m.Config.Metric.Diagnostics = false // Disable diagnostics. if err := m.Run(); err != nil { panic(err) } diff --git a/test/pilosa.go b/test/pilosa.go index 2af248098..267e2fb16 100644 --- a/test/pilosa.go +++ b/test/pilosa.go @@ -41,7 +41,6 @@ func newServer() (*server.Command, error) { s.Config.GossipSeed = "localhost:" + s.Config.GossipPort s.Config.Cluster.Type = "gossip" - s.Config.Metric.Diagnostics = false td, err := ioutil.TempDir("", "") if err != nil { return nil, errors.Wrap(err, "temp dir") @@ -101,7 +100,6 @@ func NewServerCluster(size int) (cluster *Cluster, err error) { cluster.Servers[i] = s hosts[i] = s.Config.Bind s.Config.GossipSeed = cluster.Servers[0].Config.GossipSeed - s.Config.Metric.Diagnostics = false // Disable diagnostics. }