Skip to content

Commit

Permalink
Merge branch 'master' into apply-scalafmtsbt
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsimpson authored Oct 11, 2024
2 parents 77ad210 + b8dea69 commit 1b46829
Show file tree
Hide file tree
Showing 32 changed files with 620 additions and 1,209 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: Test all the things

on: [ push, pull_request ]
env:
JAVA_OPTS: -Xms5120M -Xmx5120M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
JVM_OPTS: -Xms5120M -Xmx5120M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8

jobs:
ci:
runs-on: ubuntu-latest
env:
JAVA_OPTS: -Xms5120M -Xmx5120M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
JVM_OPTS: -Xms5120M -Xmx5120M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
runs-on: self-hosted
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- run: git fetch -f --depth=1 origin '+refs/tags/*:refs/tags/*'
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
Expand All @@ -19,9 +18,13 @@ jobs:
- name: Test
run: sbt -v ";+core/test;+instrumentation/test;+reporters/test"
lint:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
jvm: adopt:8
apps: sbt
- name: Test
run: sbt -v "+scalafmtCheckAll;scalafmtSbtCheck"
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:

jobs:
release:
runs-on: ubuntu-latest
runs-on: self-hosted
env:
JAVA_OPTS: -Xms5120M -Xmx5120M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
JVM_OPTS: -Xms5120M -Xmx5120M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- run: git fetch -f --depth=1 origin '+refs/tags/*:refs/tags/*'
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
Expand Down
18 changes: 18 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ lazy val `kamon-spring` = (project in file("instrumentation/kamon-spring"))
"org.springframework.boot" % "spring-boot-starter-webflux" % "2.4.2" % "provided",
okHttp % "test",
"com.h2database" % "h2" % "1.4.200" % "test",
"javax.xml.bind" % "jaxb-api" % "2.3.1" % "test",
"org.springframework.boot" % "spring-boot-starter-data-jpa" % "2.4.2" % "test",
scalatest % "test",
logbackClassic % "test"
Expand Down Expand Up @@ -575,6 +576,21 @@ lazy val `kamon-pekko-grpc` = (project in file("instrumentation/kamon-pekko-grpc
)
)).dependsOn(`kamon-pekko-http`, `kamon-testkit` % "test")

lazy val `kamon-pekko-connectors-kafka` = (project in file("instrumentation/kamon-pekko-connectors-kafka"))
.disablePlugins(AssemblyPlugin)
.enablePlugins(JavaAgent)
.settings(instrumentationSettings)
.settings(
crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version),
libraryDependencies ++= Seq(
kanelaAgent % "provided",
"org.apache.pekko" %% "pekko-connectors-kafka" % "1.0.0" % "provided",
"org.apache.pekko" %% "pekko-stream" % "1.0.1" % "provided",
scalatest % "test",
logbackClassic % "test"
)
).dependsOn(`kamon-core`, `kamon-pekko`, `kamon-testkit` % "test")

lazy val `kamon-akka-grpc` = (project in file("instrumentation/kamon-akka-grpc"))
.enablePlugins(JavaAgent, AkkaGrpcPlugin)
.disablePlugins(AssemblyPlugin)
Expand Down Expand Up @@ -821,6 +837,7 @@ lazy val `kamon-apache-cxf` = (project in file("instrumentation/kamon-apache-cxf
"org.mock-server" % "mockserver-client-java" % "5.13.2" % "test",
"com.dimafeng" %% "testcontainers-scala" % "0.41.0" % "test",
"com.dimafeng" %% "testcontainers-scala-mockserver" % "0.41.0" % "test",
"javax.xml.bind" % "jaxb-api" % "2.3.1" % "test",
"org.apache.cxf" % "cxf-rt-frontend-jaxws" % "3.3.6" % "test",
"org.apache.cxf" % "cxf-rt-transports-http" % "3.3.6" % "test"
)
Expand Down Expand Up @@ -1106,6 +1123,7 @@ lazy val `kamon-bundle-dependencies-2-12-and-up` = (project in file("bundle/kamo
`kamon-pekko`,
`kamon-pekko-http`,
`kamon-pekko-grpc`,
`kamon-pekko-connectors-kafka`,
`kamon-tapir`,
`kamon-alpakka-kafka`
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
/*
* Copyright 2013-2021 The Kamon Project <https://kamon.io>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package kamon.context.generated.binary.context;


// Code generated by colf(1); DO NOT EDIT.
// The compiler used schema file Context.colf.


import static java.lang.String.format;
Expand All @@ -40,20 +25,16 @@
* @author generated by colf(1)
* @see <a href="https://github.com/pascaldekloe/colfer">Colfer's home</a>
*/
@javax.annotation.Generated(value="colf(1)", comments="Colfer from schema file Context.colf")
public class BooleanTag implements Serializable {

/** The upper limit for serial byte sizes. */
public static int colferSizeMax = 16 * 1024 * 1024;




public String key;

public boolean value;


/** Default constructor */
public BooleanTag() {
init();
Expand Down Expand Up @@ -88,7 +69,6 @@ public static class Unmarshaller {
* @param buf the initial buffer or {@code null}.
*/
public Unmarshaller(InputStream in, byte[] buf) {
// TODO: better size estimation
if (buf == null || buf.length == 0)
buf = new byte[Math.min(BooleanTag.colferSizeMax, 2048)];
this.buf = buf;
Expand Down Expand Up @@ -133,7 +113,6 @@ public BooleanTag next() throws IOException {
this.i = 0;
} else if (i == buf.length) {
byte[] src = this.buf;
// TODO: better size estimation
if (offset == 0) this.buf = new byte[Math.min(BooleanTag.colferSizeMax, this.buf.length * 4)];
System.arraycopy(src, this.offset, this.buf, 0, this.i - this.offset);
this.i -= this.offset;
Expand All @@ -154,6 +133,16 @@ public BooleanTag next() throws IOException {

}

/**
* Gets the serial size estimate as an upper boundary, whereby
* {@link #marshal(byte[],int)} ≤ {@link #marshalFit()} ≤ {@link #colferSizeMax}.
* @return the number of bytes.
*/
public int marshalFit() {
long n = 1L + 6 + (long)this.key.length() * 3 + 1;
if (n < 0 || n > (long)BooleanTag.colferSizeMax) return BooleanTag.colferSizeMax;
return (int) n;
}

/**
* Serializes the object.
Expand All @@ -165,22 +154,16 @@ public BooleanTag next() throws IOException {
* @throws IllegalStateException on an upper limit breach defined by {@link #colferSizeMax}.
*/
public byte[] marshal(OutputStream out, byte[] buf) throws IOException {
// TODO: better size estimation
if (buf == null || buf.length == 0)
buf = new byte[Math.min(BooleanTag.colferSizeMax, 2048)];

while (true) {
int i;
try {
i = marshal(buf, 0);
} catch (BufferOverflowException e) {
buf = new byte[Math.min(BooleanTag.colferSizeMax, buf.length * 4)];
continue;
}

out.write(buf, 0, i);
return buf;
int n = 0;
if (buf != null && buf.length != 0) try {
n = marshal(buf, 0);
} catch (BufferOverflowException e) {}
if (n == 0) {
buf = new byte[marshalFit()];
n = marshal(buf, 0);
}
out.write(buf, 0, n);
return buf;
}

/**
Expand Down Expand Up @@ -323,16 +306,8 @@ public int unmarshal(byte[] buf, int offset, int end) {

// {@link Serializable} Colfer extension.
private void writeObject(ObjectOutputStream out) throws IOException {
// TODO: better size estimation
byte[] buf = new byte[1024];
int n;
while (true) try {
n = marshal(buf, 0);
break;
} catch (BufferUnderflowException e) {
buf = new byte[4 * buf.length];
}

byte[] buf = new byte[marshalFit()];
int n = marshal(buf, 0);
out.writeInt(n);
out.write(buf, 0, n);
}
Expand Down Expand Up @@ -371,7 +346,7 @@ public void setKey(String value) {
/**
* Sets kamon/context/generated/binary/context.BooleanTag.key.
* @param value the replacement.
* @return {link this}.
* @return {@code this}.
*/
public BooleanTag withKey(String value) {
this.key = value;
Expand All @@ -397,7 +372,7 @@ public void setValue(boolean value) {
/**
* Sets kamon/context/generated/binary/context.BooleanTag.value.
* @param value the replacement.
* @return {link this}.
* @return {@code this}.
*/
public BooleanTag withValue(boolean value) {
this.value = value;
Expand All @@ -420,8 +395,8 @@ public final boolean equals(Object o) {
public final boolean equals(BooleanTag o) {
if (o == null) return false;
if (o == this) return true;
return o.getClass() == BooleanTag.class
&& (this.key == null ? o.key == null : this.key.equals(o.key))

return (this.key == null ? o.key == null : this.key.equals(o.key))
&& this.value == o.value;
}

Expand Down
Loading

0 comments on commit 1b46829

Please sign in to comment.