Skip to content

Commit

Permalink
apm-aggregation: Remove FromVTPool() and ReturnToVTPool() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
marclop authored and endorama committed Aug 12, 2024
1 parent 660ad5a commit ce229a1
Show file tree
Hide file tree
Showing 55 changed files with 22,467 additions and 0 deletions.
39 changes: 39 additions & 0 deletions copy/apm-aggregation/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2
updates:
# Go dependencies
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
groups:
otel:
patterns:
- "go.opentelemetry.io/*"
golang.org/x/:
patterns:
- "golang.org/x/*"
go-agent:
patterns:
- "go.elastic.co/apm*"
# go tools
- package-ecosystem: "gomod"
directory: "tools/"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"
# GitHub actions
- package-ecosystem: "github-actions"
directory: "/"
reviewers:
- "elastic/observablt-ci"
schedule:
interval: "weekly"
day: "sunday"
time: "22:00"
groups:
github-actions:
patterns:
- "*"
17 changes: 17 additions & 0 deletions copy/apm-aggregation/.github/workflows/add-to-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Add new issues to the project board

on:
issues:
types:
- opened
- transferred

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/elastic/projects/1286
github-token: ${{ secrets.APM_TECH_USER_TOKEN }}
35 changes: 35 additions & 0 deletions copy/apm-aggregation/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: ci
on: ["push", "pull_request"]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- run: make lint
- run: make fmt
- name: Verify repo is up-to-date
run: |
if [ -n "$(git status --porcelain)" ]; then
echo 'Updates required:'
git status
exit 1
fi
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Run tests
run: make test
29 changes: 29 additions & 0 deletions copy/apm-aggregation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
bin
testbin/*
__debug_bin

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# editor and IDE paraphernalia
.idea
*.swp
*.sw
*.iml
*~
*.DS_Store

build

# git ignore ndjson testdata files to avoid duplication across repos
# until we figure out a better way to do so
/aggregators/testdata/*.ndjson
1 change: 1 addition & 0 deletions copy/apm-aggregation/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @elastic/obs-ds-intake-services
3 changes: 3 additions & 0 deletions copy/apm-aggregation/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
303 See Other

Location: https://www.elastic.co/community/codeofconduct
93 changes: 93 additions & 0 deletions copy/apm-aggregation/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Elastic License 2.0

URL: https://www.elastic.co/licensing/elastic-license

## Acceptance

By using the software, you agree to all of the terms and conditions below.

## Copyright License

The licensor grants you a non-exclusive, royalty-free, worldwide,
non-sublicensable, non-transferable license to use, copy, distribute, make
available, and prepare derivative works of the software, in each case subject to
the limitations and conditions below.

## Limitations

You may not provide the software to third parties as a hosted or managed
service, where the service provides users with access to any substantial set of
the features or functionality of the software.

You may not move, change, disable, or circumvent the license key functionality
in the software, and you may not remove or obscure any functionality in the
software that is protected by the license key.

You may not alter, remove, or obscure any licensing, copyright, or other notices
of the licensor in the software. Any use of the licensor’s trademarks is subject
to applicable law.

## Patents

The licensor grants you a license, under any patent claims the licensor can
license, or becomes able to license, to make, have made, use, sell, offer for
sale, import and have imported the software, in each case subject to the
limitations and conditions in this license. This license does not cover any
patent claims that you cause to be infringed by modifications or additions to
the software. If you or your company make any written claim that the software
infringes or contributes to infringement of any patent, your patent license for
the software granted under these terms ends immediately. If your company makes
such a claim, your patent license ends immediately for work on behalf of your
company.

## Notices

You must ensure that anyone who gets a copy of any part of the software from you
also gets a copy of these terms.

If you modify the software, you must include in any modified copies of the
software prominent notices stating that you have modified the software.

## No Other Rights

These terms do not imply any licenses other than those expressly granted in
these terms.

## Termination

If you use the software in violation of these terms, such use is not licensed,
and your licenses will automatically terminate. If the licensor provides you
with a notice of your violation, and you cease all violation of this license no
later than 30 days after you receive that notice, your licenses will be
reinstated retroactively. However, if you violate these terms after such
reinstatement, any additional violation of these terms will cause your licenses
to terminate automatically and permanently.

## No Liability

*As far as the law allows, the software comes as is, without any warranty or
condition, and the licensor will not be liable to you for any damages arising
out of these terms or the use or nature of the software, under any kind of
legal claim.*

## Definitions

The **licensor** is the entity offering these terms, and the **software** is the
software the licensor makes available under these terms, including any portion
of it.

**you** refers to the individual or entity agreeing to these terms.

**your company** is any legal entity, sole proprietorship, or other kind of
organization that you work for, plus all organizations that have control over,
are under the control of, or are under common control with that
organization. **control** means ownership of substantially all the assets of an
entity, or the power to direct its management and policies by vote, contract, or
otherwise. Control can be direct or indirect.

**your licenses** are all the licenses granted to you for the software under
these terms.

**use** means anything you do with the software requiring one of your licenses.

**trademark** means trademarks, service marks, and similar rights.
55 changes: 55 additions & 0 deletions copy/apm-aggregation/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.DEFAULT_GOAL := all
all: test

fmt: tools/go.mod
@go run -modfile=tools/go.mod github.com/elastic/go-licenser -license=Elasticv2 .
@go run -modfile=tools/go.mod golang.org/x/tools/cmd/goimports -local github.com/elastic/ -w .

lint: tools/go.mod
for dir in $(shell find . -type f -name go.mod -exec dirname '{}' \;); do (cd $$dir && go mod tidy && git diff --stat --exit-code -- go.mod go.sum) || exit $$?; done
go run -modfile=tools/go.mod honnef.co/go/tools/cmd/staticcheck -checks=all ./...

protolint:
docker run --volume "$(PWD):/workspace" --workdir /workspace bufbuild/buf lint proto
docker run --volume "$(PWD):/workspace" --workdir /workspace bufbuild/buf breaking proto --against https://github.com/elastic/apm-aggregation.git#branch=main,subdir=proto

.PHONY: clean
clean:
rm -fr bin build

.PHONY: test
test: go.mod
go test -v -race ./...

##############################################################################
# Protobuf generation
##############################################################################

GITROOT ?= $(shell git rev-parse --show-toplevel)
GOOSBUILD:=$(GITROOT)/build/$(shell go env GOOS)
PROTOC=$(GOOSBUILD)/protoc/bin/protoc
PROTOC_GEN_GO_VTPROTO=$(GOOSBUILD)/protoc-gen-go-vtproto
PROTOC_GEN_GO=$(GOOSBUILD)/protoc-gen-go

$(PROTOC):
@./tools/install-protoc.sh

$(PROTOC_GEN_GO_VTPROTO): $(GITROOT)/tools/go.mod
go build -o $@ -modfile=$< github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto

$(PROTOC_GEN_GO): $(GITROOT)/tools/go.mod
go build -o $@ -modfile=$< google.golang.org/protobuf/cmd/protoc-gen-go

PROTOC_OUT?=.

.PHONY: gen-proto
gen-proto: $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_VTPROTO) $(PROTOC)
$(eval STRUCTS := $(shell grep '^message' proto/*.proto | cut -d ' ' -f2))
$(eval PROTOC_VT_STRUCTS := $(shell for s in $(STRUCTS); do echo --go-vtproto_opt=pool=./aggregationpb.$$s ;done))
$(PROTOC) -I . --go_out=$(PROTOC_OUT) --plugin protoc-gen-go="$(PROTOC_GEN_GO)" \
--go-vtproto_out=$(PROTOC_OUT) --plugin protoc-gen-go-vtproto="$(PROTOC_GEN_GO_VTPROTO)" \
--go-vtproto_opt=features=marshal+unmarshal+size+pool+clone \
$(PROTOC_VT_STRUCTS) \
$(wildcard proto/*.proto)
go generate ./aggregators/internal/protohash
$(MAKE) fmt
2 changes: 2 additions & 0 deletions copy/apm-aggregation/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Elastic APM Aggregation
Copyright 2023-2023 Elasticsearch B.V.
Loading

0 comments on commit ce229a1

Please sign in to comment.