JVM support for using Noelware Analytics for your applications.
Noelware Analytics for JVM (analytics-jvm
) is a library to support client and server support of the Noelware Analytics
protocol for the JVM with Kotlin support.
The library comes in a form of plugins to plug in external sources to include in your Noelware Analytics instance that can be visualised on the web dashboard.
You will need the instance service token to use the client for yourself.
// Add the "org.noelware.analytics:client:<VERSION>" to the project before
// copying.
import org.noelware.analytics.jvm.client.blocking.BlockingAnalyticsClient;
import org.noelware.analytics.jvm.client.responses.ConnectionAckResponse;
import org.noelware.analytics.jvm.client.responses.InstanceStatsResponse;
import org.noelware.analytics.jvm.client.query.QueryBuilder;
// The client also supports asynchronous clients that use the CompletableFuture
// API. This will only demonstrate the blocking APIs.
public class Program {
public static void main(String[] args) {
final BlockingAnalyticsClient client = new BlockingAnalyticsClient.Builder()
.withServiceToken("<token from dashboard>")
.withChannelBuilder(builder -> {
// builder => the gRPC channel builder
builder.usePlaintext();
})
.build();
final ConnectionAckResponse res = client.connect();
System.out.println("connected? " + res.connected() ? "yes" : "no");
final InstanceStatsResponse stats = client.collectStats();
System.out.println(stats);
}
}
You will still need your instance service token to validate requests from incoming traffic. The service token holds as a way to block traffic that isn't from any client that doesn't have the service token available.
import org.noelware.analytics.jvm.server.extensions.jvm.JvmMemoryPoolExtension;
import org.noelware.analytics.jvm.server.extensions.jvm.JvmThreadsPluginExtension;
import org.noelware.analytics.jvm.server.AnalyticsServerBuilder;
import org.noelware.analytics.jvm.server.AnalyticsServer;
public class Program {
public static void main(String[] args) {
final AnalyticsServer server = new AnalyticsServerBuilder(55123)
.withExtensions(new JvmMemoryPoolPlugin(), new JvmThreadsPlugin())
.withServiceToken("<service token from dashboard>")
.build();
server.start();
}
}
repositories {
maven 'https://maven.noelware.org'
gradlePluginPortal()
mavenCentral()
}
dependencies {
implementation 'org.noelware.analytics:bom:<VERSION>'
}
repositories {
maven("https://maven.noelware.org")
gradlePluginPortal()
mavenCentral()
}
dependencies {
implementation("org.noelware.analytics:analytics-bom:<VERSION>")
implementation("org.noelware.analytics:client")
}
<repositories>
<repository>
<url>https://maven.noelware.org</url>
</repository>
</repositories>
<dependencies>
<dependency>
<group>org.noelware.analytics</group>
<artifactId>analytics-bom</artifactId>
<version>{VERSION}</version>
<type>pom</type>
</dependency>
</dependencies>
Thanks for considering contributing to analytics-jvm! Before you boop your heart out on your keyboard ✧ ─=≡Σ((( つ•̀ω•́)つ, we recommend you to do the following:
- Read the Code of Conduct
- Read the Contributing Guide
If you read both if you're a new time contributor, now you can do the following:
- Fork me! **♡( ⁎ᵕᴗᵕ⁎ )
- Clone your fork on your machine:
git clone https://github.com/your-username/analytics-jvm
- Create a new branch:
git checkout -b some-branch-name
- BOOP THAT KEYBOARD!!!! ♡┉ˏ͛ (❛ 〰 ❛)ˊˎ┉♡
- Commit your changes onto your branch:
git commit -am "add features (。>‿‿<。 )"
- Push it to the fork you created:
git push -u origin some-branch-name
- Submit a Pull Request and then cry! 。・゚゚・(థ Д థ。)・゚゚・。
Noelware Analytics for JVM (analytics-jvm
) is released under the MIT License by Noelware, with love. :3