Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Use generic map to store entries #102

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .ci
7 changes: 7 additions & 0 deletions .excludecoverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_mock.go
_gen.go
_matcher.go
generated/
tools/
vendor/
integration/
2 changes: 2 additions & 0 deletions .excludelint
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(vendor/)
(generated/)
(_mock.go)
(_gen.go)
(_string.go)
1 change: 1 addition & 0 deletions .excludemetalint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor/
generated/
_mock.go
_gen.go
42 changes: 27 additions & 15 deletions .metalinter.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
{
"Linters": {
"badtime": {"Command": "badtime", "Pattern": "PATH:LINE:COL:MESSAGE"},
"deadcode": { "Command": "deadcode -tags integration" },
"varcheck": { "Command": "varcheck -tags integration" },
"megacheck": { "Command": "megacheck -tags integration" } },
"Enable":
[ "deadcode"
, "varcheck"
, "structcheck"
, "goconst"
, "ineffassign"
, "unconvert"
, "misspell"
, "unparam"
, "badtime"
, "megacheck" ],
"badtime": {
"Command": "badtime",
"Pattern": "PATH:LINE:COL:MESSAGE"
},
"deadcode": {
"Command": "deadcode -tags integration"
},
"varcheck": {
"Command": "varcheck -tags integration"
},
"megacheck": {
"Command": "megacheck -tags integration"
}
},
"Enable": [
"golint",
"deadcode",
"varcheck",
"structcheck",
"goconst",
"ineffassign",
"unconvert",
"misspell",
"unparam",
"badtime",
"megacheck"
],
"Deadline": "3m",
"EnableGC": true
}
18 changes: 11 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
language: go
go:
- 1.8.3
- 1.9.2
- "1.9.x"
- "1.10.x"
install: make install-ci
env:
# Set higher timeouts and package name for travis
- TEST_TIMEOUT_SCALE=20 PACKAGE=github.com/m3db/m3aggregator
sudo: required
dist: trusty
script:
- make all
env:
global:
- TEST_TIMEOUT_SCALE=20 PACKAGE=github.com/m3db/m3aggregator
matrix:
- MAKE_TARGET="test-ci-unit"
- MAKE_TARGET="test-ci-integration"
- MAKE_TARGET="metalint"
- MAKE_TARGET="test-genny-all"
script: "make $MAKE_TARGET"
10 changes: 3 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ coverfile := cover.out
coverage_xml := coverage.xml
junit_xml := junit.xml
test_log := test.log
lint_check := .ci/lint.sh
metalint_check := .ci/metalint.sh
metalint_config := .metalinter.json
metalint_exclude := .excludemetalint
Expand All @@ -28,6 +27,8 @@ auto_gen := .ci/auto-gen.sh
license_dir := .ci/uber-licence
license_node_modules := $(license_dir)/node_modules

include $(SELF_DIR)/generated-source-files.mk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't see this file in the diff/on master, do you need to create still?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol nvm, i'm blind


BUILD := $(abspath ./bin)
LINUX_AMD64_ENV := GOOS=linux GOARCH=amd64 CGO_ENABLED=0

Expand Down Expand Up @@ -60,11 +61,6 @@ services-linux-amd64:

$(foreach SERVICE,$(SERVICES),$(eval $(SERVICE_RULES)))

.PHONY: lint
lint:
@which golint > /dev/null || go get -u github.com/golang/lint/golint
$(lint_check)

.PHONY: metalint
metalint: install-metalinter install-linter-badtime
@($(metalint_check) $(metalint_config) $(metalint_exclude) && echo "metalinted successfully!") || (echo "metalinter failed" && exit 1)
Expand Down Expand Up @@ -139,7 +135,7 @@ clean:
@rm -f *.html *.xml *.out *.test

.PHONY: all
all: lint metalint test-ci-unit test-ci-integration m3aggregator
all: metalint test-ci-unit test-ci-integration test-genny-all m3aggregator
@echo Made all successfully

.DEFAULT_GOAL := all
4 changes: 2 additions & 2 deletions aggregator/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func TestAggregatorAddMetricWithPoliciesListSuccessNoPlacementUpdate(t *testing.
agg.shardFn = func([]byte, int) uint32 { return 1 }
err := agg.AddMetricWithPoliciesList(testValidMetric, testPoliciesList)
require.NoError(t, err)
require.Equal(t, 1, len(agg.shards[1].metricMap.entries))
require.Equal(t, 1, agg.shards[1].metricMap.entries.Len())
}

func TestAggregatorAddMetricWithPoliciesListSuccessWithPlacementUpdate(t *testing.T) {
Expand Down Expand Up @@ -347,7 +347,7 @@ func TestAggregatorAddMetricWithPoliciesListSuccessWithPlacementUpdate(t *testin
require.Equal(t, expected.latestNanos, agg.shards[i].latestWriteableNanos)
}
}
require.Equal(t, 1, len(agg.shards[1].metricMap.entries))
require.Equal(t, 1, agg.shards[1].metricMap.entries.Len())
require.Equal(t, newPlacementCutoverNanos, agg.currPlacement.CutoverNanos())

for {
Expand Down
Loading