Skip to content

Commit c090512

Browse files
Initial release (#1)
* Initial release * Use records instead of messages, print per-thread performance at the end of the run * Implements log4j and proper dropwizards metrics * Adds total bytes sent and proper time elapsed * Fixes accidental commit, reportInterval print * Reflect changes from rlp_09 * Create RelpFlooderIteratorFactory implementation and pass it * Optimize imports * Support sending only x amount of messages * Adds synchronized thread iterator & config to use it * Replace event with record * Fixes off by one bug in synchronized iterator * Rebrand SynchronizedMessageIterator to SpecificCountMessageIterator * SharedTotalMessageIterator instead * Sets rlp_09 version
1 parent d36ed76 commit c090512

13 files changed

Lines changed: 1024 additions & 21 deletions

.github/workflows/release.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [created]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Set up JDK 8
18+
uses: actions/setup-java@v3
19+
with:
20+
java-version: '8'
21+
distribution: 'temurin'
22+
server-id: github
23+
settings-path: ${{ github.workspace }}
24+
25+
- name: Build jar
26+
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean package
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Pack RPM
31+
run: cd rpm/ && mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= -f rpm.pom.xml package
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Attach rpm to release
36+
uses: softprops/action-gh-release@v1
37+
with:
38+
files: |
39+
rpm/target/rpm/com.teragrep-rlp_10/RPMS/noarch/com.teragrep-rlp_10-*.noarch.rpm
40+
target/rlp_10-*-jar-with-dependencies.jar

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
target

README.adoc

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,50 @@
1-
// Before publishing your new repository:
2-
// 1. Write the readme file
3-
// 2. Update the issues link in Contributing section in the readme file
4-
// 3. Update the discussion link in config.yml file in .github/ISSUE_TEMPLATE directory
1+
= RELP Flooder library rlp_10
52

6-
# repo-template
3+
Standalone version of https://github.com/teragrep/rlp_09[rlp_09]
74

8-
// Add a short description of your project. Tell what your project does and what it's used for.
5+
== Features
96

10-
This is a template repository for Teragrep organization.
7+
- Simple to use
8+
- Scales to as many threads as wanted
119

12-
## Features
10+
== Limitations
1311

14-
// List your project's features
12+
- Minimal failure tolerance, mostly meant for testing
13+
- Limited usability outside specific testing situations
14+
- Supports only one record per RELP batch
15+
- Doesn't support dynamic message modification
16+
- No TLS support yet
1517

16-
## Documentation
18+
== How to use
1719

18-
See the official documentation on https://docs.teragrep.com[docs.teragrep.com].
20+
`mvn clean package`
1921

20-
## Limitations
22+
== How to run
2123

22-
// If your project has limitations, please list them. Otherwise remove this section.
24+
`java -jar rlp_10.jar`
2325

24-
## How to [compile/use/implement]
26+
== Configurations
2527

26-
// add instructions how people can start to use your project
2728

28-
## Contributing
29+
[cols="3"]
30+
|===
31+
|System property|Default value|Usage
2932

30-
// Change the repository name in the issues link to match with your project's name
33+
|hostname|localhost|Sets hostname for the record
34+
|appname|rlp_10|Sets used appname for the record
35+
|target|127.0.0.1|RELP target server
36+
|port|1601|RELP target port
37+
|threads|4|RELP Flooder thread count
38+
|useTls|false|Is TLS used for connections
39+
|payloadSize|10|Record message extra padding
40+
|reportInterval|10|How often report should be printed
41+
|maxRecordsSent|-1|How many records should be sent (-1 for infinity). By default, this is per-thread but with usePerThreadIterator=false it is the total amount.
42+
|usePerThreadIterator|true|Should each thread act as an independent iterator (will send maxRecordsSent * threads amount of records)
43+
|===
3144

32-
You can involve yourself with our project by https://github.com/teragrep/repo-template/issues/new/choose[opening an issue] or submitting a pull request.
45+
== Contributing
46+
47+
You can involve yourself with our project by https://github.com/teragrep/rlp_10/issues/new/choose[opening an issue] or submitting a pull request.
3348

3449
Contribution requirements:
3550

@@ -40,8 +55,8 @@ Contribution requirements:
4055

4156
Read more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline].
4257

43-
### Contributor License Agreement
58+
=== Contributor License Agreement
4459

45-
Contributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.
60+
Contributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.
4661

47-
You need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories.
62+
You need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories.

pom.xml

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>com.teragrep</groupId>
4+
<artifactId>rlp_10</artifactId>
5+
<version>${revision}${sha1}${changelist}</version>
6+
<packaging>jar</packaging>
7+
<name>rlp_10</name>
8+
<properties>
9+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
10+
<maven.compiler.source>8</maven.compiler.source>
11+
<maven.compiler.target>8</maven.compiler.target>
12+
<java.version>8</java.version>
13+
<revision>0.0.1</revision>
14+
<changelist>-SNAPSHOT</changelist>
15+
<sha1/>
16+
<dropwizard-metrics.version>4.2.25</dropwizard-metrics.version>
17+
<rlp_09.version>2.0.4</rlp_09.version>
18+
<log4j2.version>2.22.1</log4j2.version>
19+
<slf4j.version>2.0.5</slf4j.version>
20+
</properties>
21+
<dependencies>
22+
<!-- dropwizard metrics -->
23+
<dependency>
24+
<groupId>io.dropwizard.metrics</groupId>
25+
<artifactId>metrics-core</artifactId>
26+
<version>${dropwizard-metrics.version}</version>
27+
</dependency>
28+
<!-- RLP_09 -->
29+
<dependency>
30+
<groupId>com.teragrep</groupId>
31+
<artifactId>rlp_09</artifactId>
32+
<version>${rlp_09.version}</version>
33+
</dependency>
34+
<!-- logging -->
35+
<dependency>
36+
<groupId>org.apache.logging.log4j</groupId>
37+
<artifactId>log4j-core</artifactId>
38+
<version>${log4j2.version}</version>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.slf4j</groupId>
42+
<artifactId>slf4j-api</artifactId>
43+
<version>${slf4j.version}</version>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.slf4j</groupId>
47+
<artifactId>slf4j-simple</artifactId>
48+
<version>${slf4j.version}</version>
49+
</dependency>
50+
51+
</dependencies>
52+
<build>
53+
<finalName>${artifactId}-${revision}${changelist}${sha1}</finalName>
54+
<plugins>
55+
<plugin>
56+
<groupId>org.apache.rat</groupId>
57+
<artifactId>apache-rat-plugin</artifactId>
58+
<version>0.15</version>
59+
<inherited>false</inherited>
60+
<executions>
61+
<execution>
62+
<phase>test</phase>
63+
<goals>
64+
<goal>check</goal>
65+
</goals>
66+
</execution>
67+
</executions>
68+
<configuration>
69+
<addDefaultLicenseMatchers>false</addDefaultLicenseMatchers>
70+
<licenses>
71+
<license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
72+
<notes>Also allow the license url to be https.</notes>
73+
<patterns>
74+
<pattern>https://github.com/teragrep/teragrep/blob/main/LICENSE</pattern>
75+
</patterns>
76+
</license>
77+
</licenses>
78+
<consoleOutput>true</consoleOutput>
79+
<excludeSubProjects>false</excludeSubProjects>
80+
<excludes>
81+
<!-- git -->
82+
<exclude>.git/**</exclude>
83+
<exclude>.gitattributes</exclude>
84+
<exclude>.gitignore</exclude>
85+
<exclude>.gitmodules</exclude>
86+
<!-- ci -->
87+
<exclude>.github/workflows/*.yml</exclude>
88+
<exclude>.github/workflows/*.yaml</exclude>
89+
<exclude>.github/ISSUE_TEMPLATE/*</exclude>
90+
<exclude>toolchains.xml</exclude>
91+
<exclude>settings.xml</exclude>
92+
<exclude>rpm/**</exclude>
93+
<!-- assembly file -->
94+
<exclude>src/main/assembly/jar-with-dependencies.xml</exclude>
95+
<!-- readme -->
96+
<exclude>README.adoc</exclude>
97+
</excludes>
98+
</configuration>
99+
</plugin>
100+
<plugin>
101+
<groupId>org.apache.maven.plugins</groupId>
102+
<artifactId>maven-enforcer-plugin</artifactId>
103+
<version>3.4.1</version>
104+
<executions>
105+
<execution>
106+
<id>enforce</id>
107+
<phase>none</phase>
108+
</execution>
109+
<execution>
110+
<id>enforce-maven</id>
111+
<goals>
112+
<goal>enforce</goal>
113+
</goals>
114+
<configuration>
115+
<rules>
116+
<requireMavenVersion>
117+
<version>3.2.5</version>
118+
</requireMavenVersion>
119+
</rules>
120+
</configuration>
121+
</execution>
122+
</executions>
123+
</plugin>
124+
<plugin>
125+
<groupId>org.apache.maven.plugins</groupId>
126+
<artifactId>maven-compiler-plugin</artifactId>
127+
<version>3.12.1</version>
128+
<configuration>
129+
<compilerArgument>-Xlint:all</compilerArgument>
130+
<source>${java.version}</source>
131+
<target>${java.version}</target>
132+
</configuration>
133+
</plugin>
134+
<plugin>
135+
<groupId>org.apache.maven.plugins</groupId>
136+
<artifactId>maven-jar-plugin</artifactId>
137+
<version>3.3.0</version>
138+
<configuration>
139+
<archive>
140+
<manifest>
141+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
142+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
143+
</manifest>
144+
</archive>
145+
</configuration>
146+
</plugin>
147+
<plugin>
148+
<groupId>org.apache.maven.plugins</groupId>
149+
<artifactId>maven-assembly-plugin</artifactId>
150+
<version>3.6.0</version>
151+
<configuration>
152+
<descriptors>
153+
<descriptor>src/main/assembly/jar-with-dependencies.xml</descriptor>
154+
</descriptors>
155+
<archive>
156+
<manifest>
157+
<mainClass>com.teragrep.rlp_10.Main</mainClass>
158+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
159+
</manifest>
160+
</archive>
161+
</configuration>
162+
<executions>
163+
<execution>
164+
<id>make-assembly</id>
165+
<phase>package</phase>
166+
<goals>
167+
<goal>single</goal>
168+
</goals>
169+
</execution>
170+
</executions>
171+
</plugin>
172+
</plugins>
173+
</build>
174+
</project>

0 commit comments

Comments
 (0)