tsdb4j-alpline

Java driver for Akumuli which makes time-series fast and easy.

License

License

GroupId

GroupId

io.webfolder
ArtifactId

ArtifactId

tsdb4j-alpline
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

tsdb4j-alpline
Java driver for Akumuli which makes time-series fast and easy.
Project URL

Project URL

https://webfolder.io
Project Organization

Project Organization

WebFolder O�
Source Code Management

Source Code Management

https://github.com/webfolderio/tsdb4j.git

Download tsdb4j-alpline

How to add to project

<!-- https://jarcasting.com/artifacts/io.webfolder/tsdb4j-alpline/ -->
<dependency>
    <groupId>io.webfolder</groupId>
    <artifactId>tsdb4j-alpline</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.webfolder/tsdb4j-alpline/
implementation 'io.webfolder:tsdb4j-alpline:1.0.0'
// https://jarcasting.com/artifacts/io.webfolder/tsdb4j-alpline/
implementation ("io.webfolder:tsdb4j-alpline:1.0.0")
'io.webfolder:tsdb4j-alpline:jar:1.0.0'
<dependency org="io.webfolder" name="tsdb4j-alpline" rev="1.0.0">
  <artifact name="tsdb4j-alpline" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.webfolder', module='tsdb4j-alpline', version='1.0.0')
)
libraryDependencies += "io.webfolder" % "tsdb4j-alpline" % "1.0.0"
[io.webfolder/tsdb4j-alpline "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

tsdb4j Apache licensed FOSSA Status

What is tsdb4j

tsdb4j is a Java driver for Akumuli which makes time-series fast and easy.

Features

  • Minimal third-party dependency: tsdb4j avoids external dependencies except Akumuli and nanojson.

  • Multiplatform: tsdb4j supports Windows, MacOS and Linux (Centos, Ubuntu, Alpine).

  • Zero Management, No Learning Curve: It takes only seconds to download, install, and run it successfully.

Supported Java Versions

Oracle/OpenJDK, GraalVM & Substrate VM.

Both the JRE and the JDK are suitable for use with this library.

Note: We only support LTS versions (8 & 11).

Supported Platforms

tsdb4j has been tested under Windows, Ubuntu, Centos, Alpine and MacOS.

Example

Select.java

public static void main(String[] args) {
  Path path = createTempDirectory("tsdb4j");
  Database database = new Database(path, "example");
  // create & open database
  database.create(1, Database.VOLUME_MIN_SIZE, true);
  if (!database.open()) {
    database.close();
      throw new RuntimeException("db open failed!");
    }
  Instant now = now();
  try (Session session = database.createSession()) {
  // insert dummy data
  session.add(now.plusSeconds(1), "cpu.usage location=Tallinn", 20.10D);
  session.add(now.plusSeconds(2), "cpu.usage location=Tallinn", 21.20D);
  session.add(now.plusSeconds(3), "cpu.usage location=Tallinn", 22.30D);
  session.add(now.plusSeconds(4), "cpu.usage location=Tallinn", 23.40D);
  // build select criteria
  SelectCriteria select = SelectCriteria.builder()
                                          .select("cpu.usage")
                                          .from(now)
                                          .to(now.plusSeconds(5))
                                        .build();
  List<String[]> list = new ArrayList<>();
  // query data
  try (SimpleCursor cursor = session.query(select)) {
    while (cursor.hasNext()) {
      String series = cursor.next();
      Tag tag = cursor.getTags().get(0);
      list.add(new String[] {
                series,
                cursor.getMetric(),
                valueOf(cursor.getValue()),
                tag.getName(),
                tag.getValue(),
                cursor.getTimestampAsInstant().toString()
              });
            }
          }
      System.out.println(of(new String[] {
          "Series", "Metric", "Value", "Tag Name", "Tag Value", "Timestamp"
        }, list.toArray(new String[][] { })));
     }
  database.close();
  database.delete();
  deleteIfExists(path);
}

How it is tested

tsdb4j is regularly built and tested on Windows, Linux and MacOS.

License

Licensed under the Apache License.

Integration with Maven

To use the official release of tsdb4j, please use the following snippet in your pom.xml file.

Add the following to your POM's <dependencies> tag:

<dependency>
    <groupId>io.webfolder</groupId>
    <artifactId>tsdb4j</artifactId>
    <version>1.0.0</version>
</dependency>

Add native library for Windows:

<dependency>
    <groupId>io.webfolder</groupId>
    <artifactId>tsdb4j-windows</artifactId>
    <version>1.0.0</version>
</dependency>

Add native library for MacOS:

<dependency>
    <groupId>io.webfolder</groupId>
    <artifactId>tsdb4j-macos</artifactId>
    <version>1.0.0</version>
</dependency>

Add native library for Linux (Centos/Ubuntu):

<dependency>
    <groupId>io.webfolder</groupId>
    <artifactId>tsdb4j-linux</artifactId>
    <version>1.0.0</version>
</dependency>

Add native library for Alpine Linux:

<dependency>
    <groupId>io.webfolder</groupId>
    <artifactId>tsdb4j-alpine</artifactId>
    <version>1.0.0</version>
</dependency>

Dependencies

Integration with libakumuli

tsdb4j communicates with Akumuli (libakumuli) via JNI and neither use TCP, UDP or HTTP protocol.

Java Dependencies

nanojson 1.6 - library size: 29 KB

Native Dependencies

libakumuli 0.8.80 - library size: 4 MB

Statically Linked

tsdb4j.dll, tsdb4j.so and tsdb4j.dylib staticly linked with Boost, apr, apr-util and sqlite3. Unlike libakumuli it's not required to install third-party dependicies with yum or apt-get.

License

FOSSA Status

Versions

Version
1.0.0