From ec36c07ebc8c8232d834f2f4636aaebd7103709b Mon Sep 17 00:00:00 2001 From: Max Jalowski Date: Sun, 26 Jun 2016 23:39:42 +0200 Subject: [PATCH] Renamed Strace-Time-Series and all its components to String-Time-Series --- .../build.gradle | 103 -- .../gradle.properties | 8 - .../serializer/gen/StraceProtocolBuffers.java | 1487 ----------------- .../converter/StraceTimeSeriesConverter.java | 114 -- .../converter/StraceTimeSeriesDefaults.java | 70 - .../JsonKassiopeiaStraceSerializer.java | 126 -- .../ProtoBufKassiopeiaStraceSerializer.java | 218 --- .../src/main/proto/StracePoint.proto | 34 - .../StraceTimeSeriesConverterTest.groovy | 115 -- .../StraceTimeSeriesDefaultsTest.groovy | 84 - .../JsonKassiopeiaStraceSerializerTest.groovy | 119 -- ...toBufKassiopeiaStraceSerializerTest.groovy | 214 --- chronix-kassiopeia-strace/LICENSE | 13 - .../LICENSE | 0 .../build.gradle | 0 .../gradle.properties | 0 .../chronix/timeseries/StringTimeSeries.java | 34 +- .../chronix/timeseries/dt/StringPoint.java | 6 +- .../timeseries/StringTimeSeriesTest.groovy | 32 +- .../timeseries/dt/StringPointTest.groovy | 14 +- settings.gradle | 4 +- 21 files changed, 45 insertions(+), 2750 deletions(-) delete mode 100644 chronix-kassiopeia-converter-strace/build.gradle delete mode 100644 chronix-kassiopeia-converter-strace/gradle.properties delete mode 100644 chronix-kassiopeia-converter-strace/src/main/generated/de/qaware/chronix/converter/serializer/gen/StraceProtocolBuffers.java delete mode 100644 chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/StraceTimeSeriesConverter.java delete mode 100644 chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/StraceTimeSeriesDefaults.java delete mode 100644 chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/serializer/JsonKassiopeiaStraceSerializer.java delete mode 100644 chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/serializer/ProtoBufKassiopeiaStraceSerializer.java delete mode 100644 chronix-kassiopeia-converter-strace/src/main/proto/StracePoint.proto delete mode 100644 chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/StraceTimeSeriesConverterTest.groovy delete mode 100644 chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/StraceTimeSeriesDefaultsTest.groovy delete mode 100644 chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/serializer/JsonKassiopeiaStraceSerializerTest.groovy delete mode 100644 chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/serializer/ProtoBufKassiopeiaStraceSerializerTest.groovy delete mode 100644 chronix-kassiopeia-strace/LICENSE rename {chronix-kassiopeia-converter-strace => chronix-kassiopeia-string}/LICENSE (100%) rename {chronix-kassiopeia-strace => chronix-kassiopeia-string}/build.gradle (100%) rename {chronix-kassiopeia-strace => chronix-kassiopeia-string}/gradle.properties (100%) rename chronix-kassiopeia-strace/src/main/java/de/qaware/chronix/timeseries/StraceTimeSeries.java => chronix-kassiopeia-string/src/main/java/de/qaware/chronix/timeseries/StringTimeSeries.java (91%) rename chronix-kassiopeia-strace/src/main/java/de/qaware/chronix/timeseries/dt/StracePoint.java => chronix-kassiopeia-string/src/main/java/de/qaware/chronix/timeseries/dt/StringPoint.java (95%) rename chronix-kassiopeia-strace/src/test/groovy/de/qaware/chronix/timeseries/StraceTimeSeriesTest.groovy => chronix-kassiopeia-string/src/test/groovy/de/qaware/chronix/timeseries/StringTimeSeriesTest.groovy (82%) rename chronix-kassiopeia-strace/src/test/groovy/de/qaware/chronix/timeseries/dt/StracePointTest.groovy => chronix-kassiopeia-string/src/test/groovy/de/qaware/chronix/timeseries/dt/StringPointTest.groovy (70%) diff --git a/chronix-kassiopeia-converter-strace/build.gradle b/chronix-kassiopeia-converter-strace/build.gradle deleted file mode 100644 index d24895d..0000000 --- a/chronix-kassiopeia-converter-strace/build.gradle +++ /dev/null @@ -1,103 +0,0 @@ - -dependencies { - compile project(':chronix-kassiopeia-strace') - compile project(':chronix-kassiopeia-simple-converter') - compile project(':chronix-kassiopeia-converter-common') - - compile 'de.qaware.chronix:chronix-api:0.1' - compile 'com.google.code.gson:gson:2.5' - compile 'com.google.protobuf:protobuf-java:2.6.1' - -} - -//add the generated classes to the sources -sourceSets { - main { - java { - srcDir 'src/main/java' - srcDir 'src/main/generated' - } - } -} - -task copyTestResources(type: Copy) { - from "${projectDir}/src/test/resources" - into "${buildDir}/classes/test" -} -processTestResources.dependsOn copyTestResources - -task javadocJar(type: Jar, dependsOn: groovydoc) { - classifier = 'javadoc' - from groovydoc.destinationDir -} - -artifacts { - archives sourcesJar - archives javadocJar -} - -def pomConfig = { - - inceptionYear '2016' - - scm { - connection "scm:git:${project.scmUrl}" - developerConnection "scm:git:${project.scmUrl}" - url project.websiteUrl - } - - issueManagement { - system 'GitHub' - url project.issueTrackerUrl - } - - licenses { - license([:]) { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' - } - } - - organisation { - name 'QAware GmbH' - url 'https://www.qaware.de' - } - - developers { - developer { - id 'florianlautenschlager' - name 'Florian Lautenschlager' - email 'florian.lautenschlager@qaware.de' - organization 'QAware GmbH' - organizationUrl 'https://www.qaware.de' - roles { role 'Developer' } - } - developer { - id '0xhansdampf' - name 'Max Jalowski' - email 'max.jalowski@fau.de' - organization 'FAU' - organizationUrl 'https://www.fau.de' - roles { role 'Developer' } - } - } -} - -publishing { - publications { - chronixKassiopeiaSimpleConverter(MavenPublication) { - from components.java - artifact sourcesJar - artifact javadocJar - - pom.withXml { - asNode().appendNode('name', project.displayName) - asNode().appendNode('description', project.description) - asNode().appendNode('url', project.websiteUrl) - - asNode().children().last() + pomConfig - } - } - } -} \ No newline at end of file diff --git a/chronix-kassiopeia-converter-strace/gradle.properties b/chronix-kassiopeia-converter-strace/gradle.properties deleted file mode 100644 index 413bb4e..0000000 --- a/chronix-kassiopeia-converter-strace/gradle.properties +++ /dev/null @@ -1,8 +0,0 @@ -version=0.0.1 - -displayName=Chronix Kassiopeia Strace Converter -description=Chronix Kassiopeia strace time series converter -websiteUrl=https://github.com/ChronixDB/chronix.kassiopeia -scmUrl=https://github.com/ChronixDB/chronix.kassiopeia.git -issueTrackerUrl=https://github.com/ChronixDB/chronix.kassiopeia/issues -bintrayRepo=maven \ No newline at end of file diff --git a/chronix-kassiopeia-converter-strace/src/main/generated/de/qaware/chronix/converter/serializer/gen/StraceProtocolBuffers.java b/chronix-kassiopeia-converter-strace/src/main/generated/de/qaware/chronix/converter/serializer/gen/StraceProtocolBuffers.java deleted file mode 100644 index 853c3fd..0000000 --- a/chronix-kassiopeia-converter-strace/src/main/generated/de/qaware/chronix/converter/serializer/gen/StraceProtocolBuffers.java +++ /dev/null @@ -1,1487 +0,0 @@ -/* - * Copyright (C) 2016 QAware GmbH - * - * 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: StracePoint.proto - -package de.qaware.chronix.converter.serializer.gen; - -public final class StraceProtocolBuffers { - private StraceProtocolBuffers() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - public interface PointOrBuilder extends - // @@protoc_insertion_point(interface_extends:Point) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int64 t = 1; - * - *
-     *The date as int64 (java long)
-     * 
- */ - boolean hasT(); - /** - * optional int64 t = 1; - * - *
-     *The date as int64 (java long)
-     * 
- */ - long getT(); - - /** - * required string v = 2; - */ - boolean hasV(); - /** - * required string v = 2; - */ - java.lang.String getV(); - /** - * required string v = 2; - */ - com.google.protobuf.ByteString - getVBytes(); - } - /** - * Protobuf type {@code Point} - * - *
-   *Our point
-   * 
- */ - public static final class Point extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:Point) - PointOrBuilder { - // Use Point.newBuilder() to construct. - private Point(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Point(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Point defaultInstance; - public static Point getDefaultInstance() { - return defaultInstance; - } - - public Point getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Point( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - t_ = input.readInt64(); - break; - } - case 18: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000002; - v_ = bs; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.internal_static_Point_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.internal_static_Point_fieldAccessorTable - .ensureFieldAccessorsInitialized( - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.class, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Point parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Point(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - private int bitField0_; - public static final int T_FIELD_NUMBER = 1; - private long t_; - /** - * optional int64 t = 1; - * - *
-     *The date as int64 (java long)
-     * 
- */ - public boolean hasT() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 t = 1; - * - *
-     *The date as int64 (java long)
-     * 
- */ - public long getT() { - return t_; - } - - public static final int V_FIELD_NUMBER = 2; - private java.lang.Object v_; - /** - * required string v = 2; - */ - public boolean hasV() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required string v = 2; - */ - public java.lang.String getV() { - java.lang.Object ref = v_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - v_ = s; - } - return s; - } - } - /** - * required string v = 2; - */ - public com.google.protobuf.ByteString - getVBytes() { - java.lang.Object ref = v_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - v_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - t_ = 0L; - v_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - if (!hasV()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt64(1, t_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getVBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, t_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getVBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code Point} - * - *
-     *Our point
-     * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:Point) - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.PointOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.internal_static_Point_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.internal_static_Point_fieldAccessorTable - .ensureFieldAccessorsInitialized( - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.class, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.Builder.class); - } - - // Construct using de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - t_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - v_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.internal_static_Point_descriptor; - } - - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point getDefaultInstanceForType() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.getDefaultInstance(); - } - - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point build() { - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point buildPartial() { - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point result = new de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.t_ = t_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.v_ = v_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point) { - return mergeFrom((de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point other) { - if (other == de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.getDefaultInstance()) return this; - if (other.hasT()) { - setT(other.getT()); - } - if (other.hasV()) { - bitField0_ |= 0x00000002; - v_ = other.v_; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasV()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long t_ ; - /** - * optional int64 t = 1; - * - *
-       *The date as int64 (java long)
-       * 
- */ - public boolean hasT() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - /** - * optional int64 t = 1; - * - *
-       *The date as int64 (java long)
-       * 
- */ - public long getT() { - return t_; - } - /** - * optional int64 t = 1; - * - *
-       *The date as int64 (java long)
-       * 
- */ - public Builder setT(long value) { - bitField0_ |= 0x00000001; - t_ = value; - onChanged(); - return this; - } - /** - * optional int64 t = 1; - * - *
-       *The date as int64 (java long)
-       * 
- */ - public Builder clearT() { - bitField0_ = (bitField0_ & ~0x00000001); - t_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object v_ = ""; - /** - * required string v = 2; - */ - public boolean hasV() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - /** - * required string v = 2; - */ - public java.lang.String getV() { - java.lang.Object ref = v_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - v_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * required string v = 2; - */ - public com.google.protobuf.ByteString - getVBytes() { - java.lang.Object ref = v_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - v_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * required string v = 2; - */ - public Builder setV( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - v_ = value; - onChanged(); - return this; - } - /** - * required string v = 2; - */ - public Builder clearV() { - bitField0_ = (bitField0_ & ~0x00000002); - v_ = getDefaultInstance().getV(); - onChanged(); - return this; - } - /** - * required string v = 2; - */ - public Builder setVBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - v_ = value; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:Point) - } - - static { - defaultInstance = new Point(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:Point) - } - - public interface PointsOrBuilder extends - // @@protoc_insertion_point(interface_extends:Points) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .Point p = 1; - * - *
-     *The list of points
-     * 
- */ - java.util.List - getPList(); - /** - * repeated .Point p = 1; - * - *
-     *The list of points
-     * 
- */ - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point getP(int index); - /** - * repeated .Point p = 1; - * - *
-     *The list of points
-     * 
- */ - int getPCount(); - /** - * repeated .Point p = 1; - * - *
-     *The list of points
-     * 
- */ - java.util.List - getPOrBuilderList(); - /** - * repeated .Point p = 1; - * - *
-     *The list of points
-     * 
- */ - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.PointOrBuilder getPOrBuilder( - int index); - } - /** - * Protobuf type {@code Points} - * - *
-   *The data of a time series is a list of points
-   * 
- */ - public static final class Points extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:Points) - PointsOrBuilder { - // Use Points.newBuilder() to construct. - private Points(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Points(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final Points defaultInstance; - public static Points getDefaultInstance() { - return defaultInstance; - } - - public Points getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Points( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - p_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - p_.add(input.readMessage(de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.PARSER, extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - p_ = java.util.Collections.unmodifiableList(p_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.internal_static_Points_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.internal_static_Points_fieldAccessorTable - .ensureFieldAccessorsInitialized( - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points.class, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points.Builder.class); - } - - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Points parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Points(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public static final int P_FIELD_NUMBER = 1; - private java.util.List p_; - /** - * repeated .Point p = 1; - * - *
-     *The list of points
-     * 
- */ - public java.util.List getPList() { - return p_; - } - /** - * repeated .Point p = 1; - * - *
-     *The list of points
-     * 
- */ - public java.util.List - getPOrBuilderList() { - return p_; - } - /** - * repeated .Point p = 1; - * - *
-     *The list of points
-     * 
- */ - public int getPCount() { - return p_.size(); - } - /** - * repeated .Point p = 1; - * - *
-     *The list of points
-     * 
- */ - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point getP(int index) { - return p_.get(index); - } - /** - * repeated .Point p = 1; - * - *
-     *The list of points
-     * 
- */ - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.PointOrBuilder getPOrBuilder( - int index) { - return p_.get(index); - } - - private void initFields() { - p_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - for (int i = 0; i < getPCount(); i++) { - if (!getP(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < p_.size(); i++) { - output.writeMessage(1, p_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < p_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, p_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code Points} - * - *
-     *The data of a time series is a list of points
-     * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:Points) - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.PointsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.internal_static_Points_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.internal_static_Points_fieldAccessorTable - .ensureFieldAccessorsInitialized( - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points.class, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points.Builder.class); - } - - // Construct using de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getPFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - if (pBuilder_ == null) { - p_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - pBuilder_.clear(); - } - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.internal_static_Points_descriptor; - } - - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points getDefaultInstanceForType() { - return de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points.getDefaultInstance(); - } - - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points build() { - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points buildPartial() { - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points result = new de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points(this); - int from_bitField0_ = bitField0_; - if (pBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - p_ = java.util.Collections.unmodifiableList(p_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.p_ = p_; - } else { - result.p_ = pBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points) { - return mergeFrom((de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points other) { - if (other == de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points.getDefaultInstance()) return this; - if (pBuilder_ == null) { - if (!other.p_.isEmpty()) { - if (p_.isEmpty()) { - p_ = other.p_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePIsMutable(); - p_.addAll(other.p_); - } - onChanged(); - } - } else { - if (!other.p_.isEmpty()) { - if (pBuilder_.isEmpty()) { - pBuilder_.dispose(); - pBuilder_ = null; - p_ = other.p_; - bitField0_ = (bitField0_ & ~0x00000001); - pBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getPFieldBuilder() : null; - } else { - pBuilder_.addAllMessages(other.p_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - for (int i = 0; i < getPCount(); i++) { - if (!getP(i).isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Points) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List p_ = - java.util.Collections.emptyList(); - private void ensurePIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - p_ = new java.util.ArrayList(p_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.Builder, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.PointOrBuilder> pBuilder_; - - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public java.util.List getPList() { - if (pBuilder_ == null) { - return java.util.Collections.unmodifiableList(p_); - } else { - return pBuilder_.getMessageList(); - } - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public int getPCount() { - if (pBuilder_ == null) { - return p_.size(); - } else { - return pBuilder_.getCount(); - } - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point getP(int index) { - if (pBuilder_ == null) { - return p_.get(index); - } else { - return pBuilder_.getMessage(index); - } - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public Builder setP( - int index, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point value) { - if (pBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePIsMutable(); - p_.set(index, value); - onChanged(); - } else { - pBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public Builder setP( - int index, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.Builder builderForValue) { - if (pBuilder_ == null) { - ensurePIsMutable(); - p_.set(index, builderForValue.build()); - onChanged(); - } else { - pBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public Builder addP(de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point value) { - if (pBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePIsMutable(); - p_.add(value); - onChanged(); - } else { - pBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public Builder addP( - int index, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point value) { - if (pBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePIsMutable(); - p_.add(index, value); - onChanged(); - } else { - pBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public Builder addP( - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.Builder builderForValue) { - if (pBuilder_ == null) { - ensurePIsMutable(); - p_.add(builderForValue.build()); - onChanged(); - } else { - pBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public Builder addP( - int index, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.Builder builderForValue) { - if (pBuilder_ == null) { - ensurePIsMutable(); - p_.add(index, builderForValue.build()); - onChanged(); - } else { - pBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public Builder addAllP( - java.lang.Iterable values) { - if (pBuilder_ == null) { - ensurePIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, p_); - onChanged(); - } else { - pBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public Builder clearP() { - if (pBuilder_ == null) { - p_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - pBuilder_.clear(); - } - return this; - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public Builder removeP(int index) { - if (pBuilder_ == null) { - ensurePIsMutable(); - p_.remove(index); - onChanged(); - } else { - pBuilder_.remove(index); - } - return this; - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.Builder getPBuilder( - int index) { - return getPFieldBuilder().getBuilder(index); - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.PointOrBuilder getPOrBuilder( - int index) { - if (pBuilder_ == null) { - return p_.get(index); } else { - return pBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public java.util.List - getPOrBuilderList() { - if (pBuilder_ != null) { - return pBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(p_); - } - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.Builder addPBuilder() { - return getPFieldBuilder().addBuilder( - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.getDefaultInstance()); - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.Builder addPBuilder( - int index) { - return getPFieldBuilder().addBuilder( - index, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.getDefaultInstance()); - } - /** - * repeated .Point p = 1; - * - *
-       *The list of points
-       * 
- */ - public java.util.List - getPBuilderList() { - return getPFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.Builder, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.PointOrBuilder> - getPFieldBuilder() { - if (pBuilder_ == null) { - pBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.Point.Builder, de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers.PointOrBuilder>( - p_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - p_ = null; - } - return pBuilder_; - } - - // @@protoc_insertion_point(builder_scope:Points) - } - - static { - defaultInstance = new Points(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:Points) - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Point_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_Point_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Points_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_Points_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\021StracePoint.proto\"\035\n\005Point\022\t\n\001t\030\001 \001(\003\022" + - "\t\n\001v\030\002 \002(\t\"\033\n\006Points\022\021\n\001p\030\001 \003(\0132\006.PointB" + - "E\n*de.qaware.chronix.converter.serialize" + - "r.genB\025StraceProtocolBuffersH\001" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - internal_static_Point_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_Point_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_Point_descriptor, - new java.lang.String[] { "T", "V", }); - internal_static_Points_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_Points_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_Points_descriptor, - new java.lang.String[] { "P", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/StraceTimeSeriesConverter.java b/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/StraceTimeSeriesConverter.java deleted file mode 100644 index e5d8009..0000000 --- a/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/StraceTimeSeriesConverter.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2016 QAware GmbH - * - * 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 de.qaware.chronix.converter; - -import de.qaware.chronix.converter.common.MetricTSSchema; -import de.qaware.chronix.converter.serializer.JsonKassiopeiaStraceSerializer; -import de.qaware.chronix.converter.serializer.ProtoBufKassiopeiaStraceSerializer; -import de.qaware.chronix.timeseries.StraceTimeSeries; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.Charset; - -/** - * The kassiopeia time series converter for the strace time series class - * based on de.qaware.chronix.converter.KassiopeiaSimpleConverter - * - * @author f.lautenschlager & m.jalowski - */ -public class StraceTimeSeriesConverter implements TimeSeriesConverter { - - public static final String DATA_AS_JSON_FIELD = "dataAsJson"; - public static final String DATA_FUNCTION_VALUE = "function_value"; - - private static final Logger LOGGER = LoggerFactory.getLogger(KassiopeiaSimpleConverter.class); - - @Override - public StraceTimeSeries from(BinaryTimeSeries binaryTimeSeries, long queryStart, long queryEnd) { - LOGGER.debug("Converting {} to MetricTimeSeries starting at {} and ending at {}", binaryTimeSeries, queryStart, queryEnd); - //get the metric - String metric = binaryTimeSeries.get(MetricTSSchema.METRIC).toString(); - - //Third build a minimal time series - StraceTimeSeries.Builder builder = new StraceTimeSeries.Builder(metric); - - //add all user defined attributes - binaryTimeSeries.getFields().forEach((field, value) -> { - if (MetricTSSchema.isUserDefined(field)) { - builder.attribute(field, value); - } - }); - - //Default serialization is protocol buffers. - if (binaryTimeSeries.getPoints().length > 0) { - fromProtocolBuffers(binaryTimeSeries, queryStart, queryEnd, builder); - - } else if (binaryTimeSeries.getFields().containsKey(DATA_AS_JSON_FIELD)) { - //do it from json - fromJson(binaryTimeSeries, queryStart, queryEnd, builder); - - } else if (binaryTimeSeries.get(DATA_FUNCTION_VALUE) != null) { - //we have a function (aggregation) result - String value = binaryTimeSeries.get(DATA_FUNCTION_VALUE).toString(); - long meanDate = meanDate(binaryTimeSeries); - builder.point(meanDate, value); - } - - return builder.build(); - - } - - private void fromProtocolBuffers(BinaryTimeSeries binaryTimeSeries, long queryStart, long queryEnd, StraceTimeSeries.Builder builder) { - ProtoBufKassiopeiaStraceSerializer.from(binaryTimeSeries.getPoints(), binaryTimeSeries.getStart(), binaryTimeSeries.getEnd(), queryStart, queryEnd, builder); - } - - private void fromJson(BinaryTimeSeries binaryTimeSeries, long queryStart, long queryEnd, StraceTimeSeries.Builder builder) { - String jsonString = binaryTimeSeries.get(DATA_AS_JSON_FIELD).toString(); - //Second deserialize - JsonKassiopeiaStraceSerializer serializer = new JsonKassiopeiaStraceSerializer(); - serializer.fromJson(jsonString.getBytes(Charset.forName(JsonKassiopeiaStraceSerializer.UTF_8)), queryStart, queryEnd, builder); - } - - private long meanDate(BinaryTimeSeries binaryTimeSeries) { - long start = binaryTimeSeries.getStart(); - long end = binaryTimeSeries.getEnd(); - - return start + ((end - start) / 2); - } - - @Override - public BinaryTimeSeries to(StraceTimeSeries timeSeries) { - LOGGER.debug("Converting {} to BinaryTimeSeries", timeSeries); - BinaryTimeSeries.Builder builder = new BinaryTimeSeries.Builder(); - - //serialize - byte[] compressedPoints = ProtoBufKassiopeiaStraceSerializer.to(timeSeries.points().iterator()); - - //Add the minimum required fields - builder.start(timeSeries.getStart()) - .end(timeSeries.getEnd()) - .data(compressedPoints); - - //Currently we only have a metric - builder.field(MetricTSSchema.METRIC, timeSeries.getMetric()); - - //Add a list of user defined attributes - timeSeries.attributes().forEach(builder::field); - - return builder.build(); - } -} diff --git a/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/StraceTimeSeriesDefaults.java b/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/StraceTimeSeriesDefaults.java deleted file mode 100644 index a046a2d..0000000 --- a/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/StraceTimeSeriesDefaults.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2016 QAware GmbH - * - * 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 de.qaware.chronix.converter; - -import de.qaware.chronix.timeseries.StraceTimeSeries; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.function.BinaryOperator; -import java.util.function.Function; - -/** - * Holds default group by and reduce functions for the kassiopeia-strace time series - * - * @author f.lautenschlager & m.jalowski - */ -public class StraceTimeSeriesDefaults { - - private StraceTimeSeriesDefaults() { - //avoid instances - } - - /** - * Default group by function for the metric time series class. - * Groups time series on its metric name. - */ - public static final Function GROUP_BY = StraceTimeSeries::getMetric; - - /** - * Default reduce function. - * Attributes in both collected and reduced are merged using set holding both values. - */ - public static final BinaryOperator REDUCE = (collected, reduced) -> { - collected.addAll(reduced.getTimestampsAsArray(), reduced.getValuesAsArray()); - - //The collected attributes - Map attributesReference = collected.getAttributesReference(); - - //merge the attributes - //we iterate over the copy - for (HashMap.Entry entry : reduced.attributes().entrySet()) { - //Attribute to add - String attributeToAdd = entry.getKey(); - Set set = new HashSet<>(); - - if (attributesReference.containsKey(attributeToAdd)) { - Object value = attributesReference.get(attributeToAdd); - set.add(value); - } - set.add(entry.getValue()); - attributesReference.put(attributeToAdd, set); - } - return collected; - }; -} diff --git a/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/serializer/JsonKassiopeiaStraceSerializer.java b/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/serializer/JsonKassiopeiaStraceSerializer.java deleted file mode 100644 index 46acf64..0000000 --- a/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/serializer/JsonKassiopeiaStraceSerializer.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2016 QAware GmbH - * - * 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 de.qaware.chronix.converter.serializer; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonIOException; -import com.google.gson.JsonSyntaxException; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import de.qaware.chronix.timeseries.StraceTimeSeries; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.*; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.List; - -/** - * The json serializer for the kassiopeia strace - *time series - * - * @author f.lautenschlager & m.jalowski - */ -public class JsonKassiopeiaStraceSerializer { - - public static final String UTF_8 = "UTF-8"; - - private static final Logger LOGGER = LoggerFactory.getLogger(JsonKassiopeiaSimpleSerializer.class); - private static final byte[] EMPTY_JSON = "[[],[]]".getBytes(Charset.forName(UTF_8)); - private final Gson gson; - - /** - * Constructs a new JsonKassiopeiaSimpleSerializer. - */ - public JsonKassiopeiaStraceSerializer() { - GsonBuilder gsonBuilder = new GsonBuilder(); - gson = gsonBuilder.create(); - } - - /** - * Serializes the collection of metric data points to json - * - * @param timeSeries - the time series whose points should be serialized. - * @return a json serialized collection of metric data points - */ - public byte[] toJson(StraceTimeSeries timeSeries) { - - if (!timeSeries.isEmpty()) { - try { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - JsonWriter writer = new JsonWriter(new OutputStreamWriter(baos, UTF_8)); - - List[] data = new List[]{new ArrayList<>(timeSeries.size()), new ArrayList<>(timeSeries.size())}; - - for (int i = 0; i < timeSeries.size(); i++) { - data[0].add(timeSeries.getTime(i)); - data[1].add(timeSeries.getValue(i)); - } - gson.toJson(data, List[].class, writer); - writer.close(); - baos.flush(); - - return baos.toByteArray(); - } catch (IOException e) { - LOGGER.error("Could not serialize data to json", e); - - } - } - return EMPTY_JSON; - } - - /** - * Deserialize the given json to a collection of metric data points - * - * @param json the json representation of collection holding metric data points - * @param queryStart the start of the query - * @param queryEnd the end of the query - * @param builder the builder for the time series - */ - public void fromJson(byte[] json, final long queryStart, final long queryEnd, StraceTimeSeries.Builder builder) { - if (queryStart <= 0 && queryEnd <= 0) { - return; - } - - try { - ByteArrayInputStream bais = new ByteArrayInputStream(json); - JsonReader reader = new JsonReader(new InputStreamReader(bais, UTF_8)); - List[] timestampsValues = gson.fromJson(reader, List[].class); - reader.close(); - - List times = (List) timestampsValues[0]; - List values = (List) timestampsValues[1]; - - - for (int i = 0; i < times.size(); i++) { - if (times.get(i) > queryEnd) { - break; - } - - if (times.get(i) >= queryStart && times.get(i) <= queryEnd) { - builder.point(times.get(i).longValue(), values.get(i)); - } - } - - } catch (IOException | JsonSyntaxException | JsonIOException e) { - LOGGER.error("Could not deserialize json data. Returning empty lists.", e); - } - - } - -} diff --git a/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/serializer/ProtoBufKassiopeiaStraceSerializer.java b/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/serializer/ProtoBufKassiopeiaStraceSerializer.java deleted file mode 100644 index de0d4a2..0000000 --- a/chronix-kassiopeia-converter-strace/src/main/java/de/qaware/chronix/converter/serializer/ProtoBufKassiopeiaStraceSerializer.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (C) 2016 QAware GmbH - * - * 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 de.qaware.chronix.converter.serializer; - -import de.qaware.chronix.converter.common.Compression; -import de.qaware.chronix.converter.serializer.gen.StraceProtocolBuffers; -import de.qaware.chronix.timeseries.StraceTimeSeries; -import de.qaware.chronix.timeseries.dt.LongList; -import de.qaware.chronix.timeseries.dt.StracePoint; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -/** - * Class to easily convert the protocol buffer into Point - * - * @author f.lautenschlager & m.jalowski - */ -public class ProtoBufKassiopeiaStraceSerializer { - - /** - * Name of the system property to set the equals offset between the dates. - */ - public static final String DATE_EQUALS_OFFSET_MS = "DATE_EQUALS_OFFSET_MS"; - - private static final Logger LOGGER = LoggerFactory.getLogger(ProtoBufKassiopeiaSimpleSerializer.class); - private static final long ALMOST_EQUALS_OFFSET_MS = Long.parseLong(System.getProperty(DATE_EQUALS_OFFSET_MS, "10")); - - /** - * Private constructor - */ - private ProtoBufKassiopeiaStraceSerializer() { - //utility class - } - - /** - * Adds the points (compressed byte array) to the given builder - * - * @param compressedBytes the compressed bytes holding the data points - * @param timeSeriesStart the start of the time series - * @param timeSeriesEnd the end of the time series - * @param builder the time series builder - */ - public static void from(final byte[] compressedBytes, long timeSeriesStart, long timeSeriesEnd, StraceTimeSeries.Builder builder) { - from(compressedBytes, timeSeriesStart, timeSeriesEnd, timeSeriesStart, timeSeriesEnd, builder); - } - - - /** - * Adds the points (compressed byte array) to the given builder - * - * @param compressedBytes the compressed bytes holding the data points - * @param timeSeriesStart the start of the time series - * @param timeSeriesEnd the end of the time series - * @param from including points from - * @param to including points to - * @param builder the time series builder - */ - public static void from(final byte[] compressedBytes, long timeSeriesStart, long timeSeriesEnd, long from, long to, StraceTimeSeries.Builder builder) { - if (from == -1 || to == -1) { - throw new IllegalArgumentException("FROM or TO have to be >= 0"); - } - - //if to is left of the time series, we have no points to return - if (to < timeSeriesStart) { - return; - } - //if from is greater to, we have nothing to return - if (from > to) { - return; - } - - //if from is right of the time series we have nothing to return - if (from > timeSeriesEnd) { - return; - } - - try { - InputStream decompressedPointStream = Compression.decompressToStream(compressedBytes); - StraceProtocolBuffers.Points protocolBufferPoints = StraceProtocolBuffers.Points.parseFrom(decompressedPointStream); - - long lastOffset = ALMOST_EQUALS_OFFSET_MS; - long calculatedPointDate = timeSeriesStart; - - List pList = protocolBufferPoints.getPList(); - - int size = pList.size(); - StraceProtocolBuffers.Point[] points = pList.toArray(new StraceProtocolBuffers.Point[0]); - - long[] timestamps = new long[pList.size()]; - String[] values = new String[pList.size()]; - - int lastPointIndex = 0; - - for (int i = 0; i < size; i++) { - StraceProtocolBuffers.Point p = points[i]; - - if (i > 0) { - long offset = p.getT(); - if (offset != 0) { - lastOffset = offset; - } - calculatedPointDate += lastOffset; - } - - //only add the point if it is within the date - if (calculatedPointDate >= from && calculatedPointDate <= to) { - timestamps[i] = calculatedPointDate; - values[i] = p.getV(); - lastPointIndex++; - } - } - ArrayList valueList = new ArrayList<>(lastPointIndex); - valueList.addAll(Arrays.asList(values)); - builder.points(new LongList(timestamps, lastPointIndex), valueList); - - } catch (IOException e) { - LOGGER.info("Could not decode protocol buffers points"); - } - - } - - /** - * Converts the given iterator of our point class to protocol buffers and compresses (gzip) it. - * - * @param metricDataPoints - the list with points - * @return a protocol buffer points object - */ - public static byte[] to(Iterator metricDataPoints) { - long previousDate = 0; - long previousOffset = 0; - - int timesSinceLastOffset = 0; - long lastStoredDate = 0; - - StraceProtocolBuffers.Point.Builder builder = StraceProtocolBuffers.Point.newBuilder(); - StraceProtocolBuffers.Points.Builder points = StraceProtocolBuffers.Points.newBuilder(); - - - while (metricDataPoints.hasNext()) { - - StracePoint p = metricDataPoints.next(); - - if (p == null) { - LOGGER.debug("Skipping 'null' point."); - continue; - } - - long offset; - if (previousDate == 0) { - offset = 0; - // set lastStoredDate to the value of the first timestamp - lastStoredDate = p.getTimestamp(); - } else { - offset = p.getTimestamp() - previousDate; - } - - //Semantic Compression - if (ALMOST_EQUALS_OFFSET_MS == -1) { - builder.clearT() - .setV(p.getValue()); - points.addP(builder.build()); - } else { - if (almostEquals(previousOffset, offset) && noDrift(p.getTimestamp(), lastStoredDate, timesSinceLastOffset)) { - builder.clearT() - .setV(p.getValue()); - points.addP(builder.build()); - timesSinceLastOffset += 1; - - } else { - builder.setT(offset) - .setV(p.getValue()) - .build(); - points.addP(builder.build()); - //reset the offset counter - timesSinceLastOffset = 1; - lastStoredDate = p.getTimestamp(); - } - //set current as former previous date - previousOffset = offset; - previousDate = p.getTimestamp(); - } - } - - return Compression.compress(points.build().toByteArray()); - } - - private static boolean noDrift(long timestamp, long lastStoredDate, int timesSinceLastOffset) { - long calculatedMaxOffset = ALMOST_EQUALS_OFFSET_MS * timesSinceLastOffset; - long drift = lastStoredDate + calculatedMaxOffset - timestamp; - - return (drift <= (ALMOST_EQUALS_OFFSET_MS / 2)); - } - - private static boolean almostEquals(long previousOffset, long offset) { - double diff = Math.abs(offset - previousOffset); - return (diff <= ALMOST_EQUALS_OFFSET_MS); - } -} diff --git a/chronix-kassiopeia-converter-strace/src/main/proto/StracePoint.proto b/chronix-kassiopeia-converter-strace/src/main/proto/StracePoint.proto deleted file mode 100644 index 7a77a93..0000000 --- a/chronix-kassiopeia-converter-strace/src/main/proto/StracePoint.proto +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2015 QAware GmbH - * - * 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. - */ - -option java_package = "de.qaware.chronix.converter.serializer.gen"; - -option java_outer_classname = "StraceProtocolBuffers"; - -option optimize_for = SPEED; - -//Our point -message Point { - //The date as int64 (java long) - optional int64 t = 1; - required string v = 2; -} - -//The data of a time series is a list of points -message Points { - //The list of points - repeated Point p = 1; -} \ No newline at end of file diff --git a/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/StraceTimeSeriesConverterTest.groovy b/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/StraceTimeSeriesConverterTest.groovy deleted file mode 100644 index 8fcb576..0000000 --- a/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/StraceTimeSeriesConverterTest.groovy +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2016 QAware GmbH - * - * 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 de.qaware.chronix.converter - -import de.qaware.chronix.timeseries.StraceTimeSeries -import spock.lang.Specification - -import java.time.Instant - -/** - * Unit test for the kassiopeia simple converter - * @author f.lautenschlager & m.jalowski - */ -class StraceTimeSeriesConverterTest extends Specification { - - def "test to and from compressed data"() { - given: - def ts = new StraceTimeSeries.Builder("\\Load\\avg").attribute("MyField", "4711") - def start = Instant.now() - - 100.times { - ts.point(start.plusSeconds(it).toEpochMilli(), it * 2 + " as string") - } - - def converter = new StraceTimeSeriesConverter(); - - when: - def binaryTimeSeries = converter.to(ts.build()) - def tsReconverted = converter.from(binaryTimeSeries, start.toEpochMilli(), start.plusSeconds(20).toEpochMilli()) - - then: - tsReconverted.metric == "\\Load\\avg" - tsReconverted.size() == 21 - tsReconverted.getValue(1) == "2 as string" - tsReconverted.attribute("MyField") == "4711" - - } - - def "test to and from aggregated value"() { - given: - def converter = new StraceTimeSeriesConverter(); - - def binTs = new BinaryTimeSeries.Builder() - .field("function_value", "4711") - .field("metric", "\\Load\\avg") - .start(0) - .end(10) - - when: - def tsReconverted = converter.from(binTs.build(), 0, 100) - - then: - tsReconverted.metric == "\\Load\\avg" - tsReconverted.size() == 1 - tsReconverted.getValue(0) == "4711" - tsReconverted.start == 5 - tsReconverted.end == 5 - } - - def "test to and from json data"() { - given: - def converter = new StraceTimeSeriesConverter(); - - def binTs = new BinaryTimeSeries.Builder() - .field("function_value", "4711") - .field("metric", "\\Load\\avg") - .field("dataAsJson", "[[0,1,2,3],['string0','string1','string2','string3']]") - .start(0) - .end(10) - - when: - def tsReconverted = converter.from(binTs.build(), 0, 100) - - then: - tsReconverted.metric == "\\Load\\avg" - tsReconverted.size() == 4 - tsReconverted.getValue(3) == 'string3' - tsReconverted.start == 0 - tsReconverted.end == 3 - } - - def "test to and from json data with encoding exception"() { - given: - def converter = new StraceTimeSeriesConverter(); - - def binTs = new BinaryTimeSeries.Builder() - .field("function_value", "4711") - .field("metric", "\\Load\\avg") - .field("dataAsJson", new String("[[0,1,2,3],['string0','string1','string2','string3']]".getBytes("IBM420"))) - .start(0) - .end(10) - - when: - def tsReconverted = converter.from(binTs.build(), 0, 100) - - then: - tsReconverted.metric == "\\Load\\avg" - tsReconverted.size() == 0 - tsReconverted.start == 0 - tsReconverted.end == 0 - } -} diff --git a/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/StraceTimeSeriesDefaultsTest.groovy b/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/StraceTimeSeriesDefaultsTest.groovy deleted file mode 100644 index fec9959..0000000 --- a/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/StraceTimeSeriesDefaultsTest.groovy +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2016 QAware GmbH - * - * 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 de.qaware.chronix.converter - -import de.qaware.chronix.timeseries.StraceTimeSeries -import de.qaware.chronix.timeseries.dt.StracePoint -import spock.lang.Specification - -import java.util.stream.Collectors - -/** - * Unit test for the reduce and group by defaults - * @author f.lautenschlager - */ -class StraceTimeSeriesDefaultsTest extends Specification { - - def "test default group by"() { - given: - def straceTimeSeries = new StraceTimeSeries.Builder("metric").build(); - - when: - def groupBy = StraceTimeSeriesDefaults.GROUP_BY.apply(straceTimeSeries) - - then: - groupBy == "metric" - } - - def "test default reduce"() { - - given: - def ts1 = new StraceTimeSeries.Builder("metric") - .attribute("existsInBoth", 1) - .attribute("onlyInTs1", "value only in ts1") - .attribute("simpleList", ["one", "two", "three"]) - .point(1, "2") - .point(3, "6") - .point(5, "10") - .build(); - def ts2 = new StraceTimeSeries.Builder("metric") - .attribute("existsInBoth", 2) - .attribute("onlyInTs2", "ts1 would never see me") - .attribute("simpleList", ["four", "five", "six"]) - .attribute("threads", [1, 2, 3]) - .point(2, "4") - .point(4, "8") - .point(6, "12") - .build(); - when: - def merged = StraceTimeSeriesDefaults.REDUCE.apply(ts1, ts2) - - then: - merged.size() == 6 - merged.sort() - def list = merged.points().collect(Collectors.toList()) - list.containsAll([new StracePoint(0, 1, "2"), new StracePoint(1, 2, "4"), new StracePoint(2, 3, "6") - , new StracePoint(3, 4, "8"), new StracePoint(4, 5, "10"), new StracePoint(5, 6, "12")]) - merged.attributes().size() == 5 - merged.attribute("existsInBoth") as Set == [1, 2] as Set - merged.attribute("onlyInTs1") as String == "value only in ts1" - merged.attribute("onlyInTs2") as Set == ["ts1 would never see me"] as Set - merged.attribute("threads") as Set == [[1, 2, 3]] as Set - merged.attribute("simpleList") as Set == [["one", "two", "three"], ["four", "five", "six"]] as Set - } - - def "test private constructor"() { - when: - StraceTimeSeriesDefaults.newInstance() - then: - noExceptionThrown() - } -} diff --git a/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/serializer/JsonKassiopeiaStraceSerializerTest.groovy b/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/serializer/JsonKassiopeiaStraceSerializerTest.groovy deleted file mode 100644 index fdafbe9..0000000 --- a/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/serializer/JsonKassiopeiaStraceSerializerTest.groovy +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2016 QAware GmbH - * - * 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 de.qaware.chronix.converter.serializer - -import de.qaware.chronix.timeseries.StraceTimeSeries -import de.qaware.chronix.timeseries.dt.LongList -import spock.lang.Specification -import spock.lang.Unroll - -import java.nio.charset.Charset - -/** - * Unit test for the kassiopeia serializer - * @author f.lautenschlager & m.jalowski - */ -class JsonKassiopeiaStraceSerializerTest extends Specification { - - def "test serialize to and deserialize from json"() { - given: - def times = longList([0, 1, 2]) - def values = ["string0", "string1", "string2"] - def ts = new StraceTimeSeries.Builder("test").points(times, values).build() - - def serializer = new JsonKassiopeiaStraceSerializer() - def start = 0l - def end = 2l - - when: - def json = serializer.toJson(ts) - - then: - def builder = new StraceTimeSeries.Builder("test") - serializer.fromJson(json, start, end, builder) - def recoverdTs = builder.build(); - - - times.size() == 3 - recoverdTs.size() == 3 - - recoverdTs.getTime(0) == 0l - recoverdTs.getTime(1) == 1l - recoverdTs.getTime(2) == 2l - - recoverdTs.getValue(0) == "string0" - recoverdTs.getValue(1) == "string1" - recoverdTs.getValue(2) == "string2" - } - - @Unroll - def "test serialize and deserialize from json with filter #start and #end expecting #size elements"() { - given: - def times = longList([0, 1, 2, 3, 4, 5]) - def values = ["string0", "string1", "string2", "string3", "string4", "string5"] - def ts = new StraceTimeSeries.Builder("test").points(times, values).build() - - def serializer = new JsonKassiopeiaStraceSerializer() - - when: - def builder = new StraceTimeSeries.Builder("test") - - def json = serializer.toJson(ts) - serializer.fromJson(json, start, end, builder) - then: - builder.build().size() == size - - where: - start << [0, 1, 1, 0] - end << [0, 1, 3, 6] - size << [0, 1, 3, 6] - } - - def "test serialize to json with empty timestamps / values"() { - given: - def serializer = new JsonKassiopeiaStraceSerializer() - def ts = new StraceTimeSeries.Builder("test").points(times, values).build() - - when: - def json = serializer.toJson(ts) - - then: - new String(json) == "[[],[]]" - - where: - times << [null, longList([0l, 1l, 2l]) as LongList] - values << [["string0", "string1", "string2"], null] - } - - def longList(ArrayList longs) { - def times = new LongList() - longs.each { l -> times.add(l) } - - times - } - - def "test deserialize from empty json "() { - given: - def serializer = new JsonKassiopeiaStraceSerializer() - def builder = new StraceTimeSeries.Builder("test") - - when: - def result = serializer.fromJson("[[],[]]".getBytes(Charset.forName("UTF-8")), 1, 2000, builder) - def ts = builder.build() - then: - ts.size() == 0 - } -} diff --git a/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/serializer/ProtoBufKassiopeiaStraceSerializerTest.groovy b/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/serializer/ProtoBufKassiopeiaStraceSerializerTest.groovy deleted file mode 100644 index af60cb9..0000000 --- a/chronix-kassiopeia-converter-strace/src/test/groovy/de/qaware/chronix/converter/serializer/ProtoBufKassiopeiaStraceSerializerTest.groovy +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (C) 2016 QAware GmbH - * - * 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 de.qaware.chronix.converter.serializer - -import de.qaware.chronix.timeseries.StraceTimeSeries -import de.qaware.chronix.timeseries.dt.StracePoint -import spock.lang.Shared -import spock.lang.Specification - -import java.time.Instant -import java.util.stream.Collectors - -/** - * Unit test for the protocol buffers serializer - * @author f.lautenschlager & m.jalowski - */ -class ProtoBufKassiopeiaStraceSerializerTest extends Specification { - - def "test from without range query"() { - given: - def points = [] - 100.times { - points.add(new StracePoint(it, it + 1, it * 100 + " as string")) - } - def compressedProtoPoints = ProtoBufKassiopeiaStraceSerializer.to(points.iterator()) - - when: - def builder = new StraceTimeSeries.Builder("metric"); - ProtoBufKassiopeiaStraceSerializer.from(compressedProtoPoints, 0, points.size(), 0, points.size(), builder) - def ts = builder.build(); - then: - 100.times { - ts.getValue(it) == it * 100 + " as string" - ts.getTime(it) == it - } - } - - @Shared - def start = Instant.now() - @Shared - def end = start.plusSeconds(100 * 100) - - def "test from with range query"() { - given: - def points = [] - - 100.times { - points.add(new StracePoint(it, start.plusSeconds(it).toEpochMilli(), it * 100 + " as string")) - } - def compressedProtoPoints = ProtoBufKassiopeiaStraceSerializer.to(points.iterator()) - def builder = new StraceTimeSeries.Builder("metric"); - - when: - ProtoBufKassiopeiaStraceSerializer.from(compressedProtoPoints, start.toEpochMilli(), end.toEpochMilli(), from, to, builder) - def ts = builder.build(); - - then: - List list = ts.points().collect(Collectors.toList()) - list.size() == size - if (size == 21) { - list.get(0).timestamp == 1456394850774 - list.get(0).value == 5000 + " as string" - - list.get(20).timestamp == 1456394870774 - list.get(20).value == 7000 + " as string" - } - - where: - from << [end.toEpochMilli() + 2, 0, start.toEpochMilli() + 4, start.plusSeconds(50).toEpochMilli()] - to << [end.toEpochMilli() + 3, 0, start.toEpochMilli() + 2, start.plusSeconds(70).toEpochMilli()] - size << [0, 0, 0, 21] - } - - def "test convert to protocol buffers points"() { - given: - def points = [] - 100.times { - points.add(new StracePoint(it, it + 15, it * 100 + " as string")) - } - //Points that are null are ignored - points.add(null) - def builder = new StraceTimeSeries.Builder(""); - when: - def compressedPoints = ProtoBufKassiopeiaStraceSerializer.to(points.iterator()) - ProtoBufKassiopeiaStraceSerializer.from(compressedPoints, 0, 114, builder) - - then: - builder.build().size() == 100 - } - - def "test iterator with invalid arguments"() { - when: - ProtoBufKassiopeiaStraceSerializer.from(null, 0, 0, from, to, new StraceTimeSeries.Builder("")) - then: - thrown IllegalArgumentException - where: - from << [-1, 0, -1] - to << [0, -1, -1] - - } - - - def "test private constructor"() { - when: - ProtoBufKassiopeiaStraceSerializer.newInstance() - then: - noExceptionThrown() - } - - - def "test date-delta-compaction"() { - given: - def points = [] - points.add(new StracePoint(0, 10, "string0")) - points.add(new StracePoint(1, 20, "string1")) - points.add(new StracePoint(2, 30, "string2")) - points.add(new StracePoint(3, 39, "string3")) - points.add(new StracePoint(4, 48, "string4")) - points.add(new StracePoint(5, 57, "string5")) - points.add(new StracePoint(6, 66, "string6")) - points.add(new StracePoint(7, 75, "string7")) - points.add(new StracePoint(8, 84, "string8")) - points.add(new StracePoint(9, 93, "string9")) - points.add(new StracePoint(10, 102, "string10")) - points.add(new StracePoint(11, 111, "string11")) - points.add(new StracePoint(12, 120, "string12")) - points.add(new StracePoint(13, 129, "string13")) - points.add(new StracePoint(14, 138, "string14")) - - def builder = new StraceTimeSeries.Builder("metric"); - - when: - def compressedProtoPoints = ProtoBufKassiopeiaStraceSerializer.to(points.iterator()) - ProtoBufKassiopeiaStraceSerializer.from(compressedProtoPoints, 10l, 1036l, builder) - def ts = builder.build() - def listPoints = ts.points().collect(Collectors.toList()) as List - - then: //diff to origin - listPoints.get(0).timestamp == 10//0 - listPoints.get(1).timestamp == 20//0 - listPoints.get(2).timestamp == 30//0 - listPoints.get(3).timestamp == 40//1 - listPoints.get(4).timestamp == 50//2 - listPoints.get(5).timestamp == 60//3 - listPoints.get(6).timestamp == 70//4 - listPoints.get(7).timestamp == 80//5 - listPoints.get(8).timestamp == 89//5 - listPoints.get(9).timestamp == 98//5 - listPoints.get(10).timestamp == 107//5 - listPoints.get(11).timestamp == 116//5 - listPoints.get(12).timestamp == 125//5 - listPoints.get(13).timestamp == 134//5 - listPoints.get(14).timestamp == 143//5 - } - - - def "test date-delta-compaction with different values"() { - given: - def points = [] - points.add(new StracePoint(0, 1462892410, "string0")) - points.add(new StracePoint(1, 1462892420, "string1")) - points.add(new StracePoint(2, 1462892430, "string2")) - points.add(new StracePoint(3, 1462892439, "string3")) - points.add(new StracePoint(4, 1462892448, "string4")) - points.add(new StracePoint(5, 1462892457, "string5")) - points.add(new StracePoint(6, 1462892466, "string6")) - points.add(new StracePoint(7, 1462892475, "string7")) - points.add(new StracePoint(8, 1462892484, "string8")) - points.add(new StracePoint(9, 1462892493, "string9")) - points.add(new StracePoint(10, 1462892502, "string10")) - points.add(new StracePoint(11, 1462892511, "string11")) - points.add(new StracePoint(12, 1462892520, "string12")) - points.add(new StracePoint(13, 1462892529, "string13")) - points.add(new StracePoint(14, 1462892538, "string14")) - - def builder = new StraceTimeSeries.Builder("metric1"); - - when: - def compressedProtoPoints = ProtoBufKassiopeiaStraceSerializer.to(points.iterator()) - ProtoBufKassiopeiaStraceSerializer.from(compressedProtoPoints, 1462892410l, 1462892543l, builder) - def ts = builder.build() - def listPoints = ts.points().collect(Collectors.toList()) as List - - then: //diff to origin - listPoints.get(0).timestamp == 1462892410//0 - listPoints.get(1).timestamp == 1462892420//0 - listPoints.get(2).timestamp == 1462892430//0 - listPoints.get(3).timestamp == 1462892440//1 - listPoints.get(4).timestamp == 1462892450//2 - listPoints.get(5).timestamp == 1462892460//3 - listPoints.get(6).timestamp == 1462892470//4 - listPoints.get(7).timestamp == 1462892480//5 - listPoints.get(8).timestamp == 1462892489//5 - listPoints.get(9).timestamp == 1462892498//5 - listPoints.get(10).timestamp == 1462892507//5 - listPoints.get(11).timestamp == 1462892516//5 - listPoints.get(12).timestamp == 1462892525//5 - listPoints.get(13).timestamp == 1462892534//5 - listPoints.get(14).timestamp == 1462892543//5 - } -} diff --git a/chronix-kassiopeia-strace/LICENSE b/chronix-kassiopeia-strace/LICENSE deleted file mode 100644 index 1007523..0000000 --- a/chronix-kassiopeia-strace/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (C) 2016 QAware GmbH - - 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. \ No newline at end of file diff --git a/chronix-kassiopeia-converter-strace/LICENSE b/chronix-kassiopeia-string/LICENSE similarity index 100% rename from chronix-kassiopeia-converter-strace/LICENSE rename to chronix-kassiopeia-string/LICENSE diff --git a/chronix-kassiopeia-strace/build.gradle b/chronix-kassiopeia-string/build.gradle similarity index 100% rename from chronix-kassiopeia-strace/build.gradle rename to chronix-kassiopeia-string/build.gradle diff --git a/chronix-kassiopeia-strace/gradle.properties b/chronix-kassiopeia-string/gradle.properties similarity index 100% rename from chronix-kassiopeia-strace/gradle.properties rename to chronix-kassiopeia-string/gradle.properties diff --git a/chronix-kassiopeia-strace/src/main/java/de/qaware/chronix/timeseries/StraceTimeSeries.java b/chronix-kassiopeia-string/src/main/java/de/qaware/chronix/timeseries/StringTimeSeries.java similarity index 91% rename from chronix-kassiopeia-strace/src/main/java/de/qaware/chronix/timeseries/StraceTimeSeries.java rename to chronix-kassiopeia-string/src/main/java/de/qaware/chronix/timeseries/StringTimeSeries.java index 0873d95..46657bc 100644 --- a/chronix-kassiopeia-strace/src/main/java/de/qaware/chronix/timeseries/StraceTimeSeries.java +++ b/chronix-kassiopeia-string/src/main/java/de/qaware/chronix/timeseries/StringTimeSeries.java @@ -16,7 +16,7 @@ package de.qaware.chronix.timeseries; import de.qaware.chronix.timeseries.dt.LongList; -import de.qaware.chronix.timeseries.dt.StracePoint; +import de.qaware.chronix.timeseries.dt.StringPoint; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -37,7 +37,7 @@ * * @author f.lautenschlager & m.jalowski */ -public final class StraceTimeSeries implements Serializable { +public final class StringTimeSeries implements Serializable { private String metric; private LongList timestamps; @@ -49,7 +49,7 @@ public final class StraceTimeSeries implements Serializable { * Private constructor. * To instantiate a metric time series use the builder class. */ - private StraceTimeSeries() { + private StringTimeSeries() { this.timestamps = new LongList(500); this.values = new ArrayList<>(500); } @@ -130,15 +130,15 @@ public void sort() { * * @return the points as strace-points */ - public Stream points() { + public Stream points() { if (timestamps.isEmpty()) { return Stream.empty(); } return Stream.iterate(of(0), pair -> of(pair.getIndex() + 1)).limit(timestamps.size()); } - private StracePoint of(int index) { - return new StracePoint(index, timestamps.get(index), values.get(index)); + private StringPoint of(int index) { + return new StringPoint(index, timestamps.get(index), values.get(index)); } /** @@ -247,7 +247,7 @@ public boolean equals(Object obj) { if (obj.getClass() != getClass()) { return false; } - StraceTimeSeries rhs = (StraceTimeSeries) obj; + StringTimeSeries rhs = (StringTimeSeries) obj; return new EqualsBuilder() .append(this.getMetric(), rhs.getMetric()) .isEquals(); @@ -312,7 +312,7 @@ public static final class Builder { /** * The time series object */ - private StraceTimeSeries straceTimeSeries; + private StringTimeSeries stringTimeSeries; /** * Constructs a new Builder @@ -320,16 +320,16 @@ public static final class Builder { * @param metric the metric name */ public Builder(String metric) { - straceTimeSeries = new StraceTimeSeries(); - straceTimeSeries.metric = metric; + stringTimeSeries = new StringTimeSeries(); + stringTimeSeries.metric = metric; } /** * @return the filled time series */ - public StraceTimeSeries build() { - return straceTimeSeries; + public StringTimeSeries build() { + return stringTimeSeries; } @@ -342,7 +342,7 @@ public StraceTimeSeries build() { */ public Builder points(LongList timestamps, ArrayList values) { if (timestamps != null && values != null) { - straceTimeSeries.setAll(timestamps, values); + stringTimeSeries.setAll(timestamps, values); } return this; } @@ -355,8 +355,8 @@ public Builder points(LongList timestamps, ArrayList values) { * @return the builder */ public Builder point(long timestamp, String value) { - straceTimeSeries.timestamps.add(timestamp); - straceTimeSeries.values.add(value); + stringTimeSeries.timestamps.add(timestamp); + stringTimeSeries.values.add(value); return this; } @@ -368,7 +368,7 @@ public Builder point(long timestamp, String value) { * @return the builder */ public Builder attribute(String key, Object value) { - straceTimeSeries.addAttribute(key, value); + stringTimeSeries.addAttribute(key, value); return this; } @@ -379,7 +379,7 @@ public Builder attribute(String key, Object value) { * @return the builder */ public Builder attributes(Map attributes) { - straceTimeSeries.attributes = attributes; + stringTimeSeries.attributes = attributes; return this; } diff --git a/chronix-kassiopeia-strace/src/main/java/de/qaware/chronix/timeseries/dt/StracePoint.java b/chronix-kassiopeia-string/src/main/java/de/qaware/chronix/timeseries/dt/StringPoint.java similarity index 95% rename from chronix-kassiopeia-strace/src/main/java/de/qaware/chronix/timeseries/dt/StracePoint.java rename to chronix-kassiopeia-string/src/main/java/de/qaware/chronix/timeseries/dt/StringPoint.java index d378797..956e078 100644 --- a/chronix-kassiopeia-strace/src/main/java/de/qaware/chronix/timeseries/dt/StracePoint.java +++ b/chronix-kassiopeia-string/src/main/java/de/qaware/chronix/timeseries/dt/StringPoint.java @@ -26,7 +26,7 @@ * * @author Max Jalowski */ -public class StracePoint { +public class StringPoint { private int index; private long timestamp; private String value; @@ -38,7 +38,7 @@ public class StracePoint { * @param timestamp - the timestamp * @param value - the value */ - public StracePoint(int index, long timestamp, String value) { + public StringPoint(int index, long timestamp, String value) { this.index = index; this.timestamp = timestamp; this.value = value; @@ -70,7 +70,7 @@ public boolean equals(Object o) { if (o == null) return false; if (o == this) return true; if (o.getClass() != getClass()) return false; - StracePoint sp = (StracePoint) o; + StringPoint sp = (StringPoint) o; return new EqualsBuilder() .append(this.index, sp.index) .append(this.timestamp, sp.timestamp) diff --git a/chronix-kassiopeia-strace/src/test/groovy/de/qaware/chronix/timeseries/StraceTimeSeriesTest.groovy b/chronix-kassiopeia-string/src/test/groovy/de/qaware/chronix/timeseries/StringTimeSeriesTest.groovy similarity index 82% rename from chronix-kassiopeia-strace/src/test/groovy/de/qaware/chronix/timeseries/StraceTimeSeriesTest.groovy rename to chronix-kassiopeia-string/src/test/groovy/de/qaware/chronix/timeseries/StringTimeSeriesTest.groovy index efdc052..faaf201 100644 --- a/chronix-kassiopeia-strace/src/test/groovy/de/qaware/chronix/timeseries/StraceTimeSeriesTest.groovy +++ b/chronix-kassiopeia-string/src/test/groovy/de/qaware/chronix/timeseries/StringTimeSeriesTest.groovy @@ -22,7 +22,7 @@ import spock.lang.Unroll /** * */ -class StraceTimeSeriesTest extends Specification { +class StringTimeSeriesTest extends Specification { @Unroll def "test create a strace time series and access its values"() { @@ -38,7 +38,7 @@ class StraceTimeSeriesTest extends Specification { attributes.put("cmd", "strace ls") when: - def ts = new StraceTimeSeries.Builder("ls") + def ts = new StringTimeSeries.Builder("ls") .attributes(attributes) .attribute("prog", "ls") .points(times, values) @@ -72,7 +72,7 @@ class StraceTimeSeriesTest extends Specification { times.add(100 - it as long) values.add(it * 10 as String) } - def ts = new StraceTimeSeries.Builder("//CPU//Load").points(times, values).build() + def ts = new StringTimeSeries.Builder("//CPU//Load").points(times, values).build() when: @@ -90,7 +90,7 @@ class StraceTimeSeriesTest extends Specification { times.add(100 - it as long) values.add(100 - it as String) } - def ts = new StraceTimeSeries.Builder("//CPU//Load").build() + def ts = new StringTimeSeries.Builder("//CPU//Load").build() ts.addAll(times, values) when: @@ -102,7 +102,7 @@ class StraceTimeSeriesTest extends Specification { def "test sort on empty time series"() { given: - def ts = new StraceTimeSeries.Builder("//CPU//Load").build() + def ts = new StringTimeSeries.Builder("//CPU//Load").build() when: ts.sort() @@ -122,7 +122,7 @@ class StraceTimeSeriesTest extends Specification { values.add(it * 10 as String) } - def ts = new StraceTimeSeries.Builder("//CPU//Load") + def ts = new StringTimeSeries.Builder("//CPU//Load") .points(times, values) .build() @@ -138,7 +138,7 @@ class StraceTimeSeriesTest extends Specification { def "test to string"() { given: - def ts = new StraceTimeSeries.Builder("//CPU//Load").build() + def ts = new StringTimeSeries.Builder("//CPU//Load").build() when: def string = ts.toString() @@ -149,7 +149,7 @@ class StraceTimeSeriesTest extends Specification { def "test equals"() { given: - def ts = new StraceTimeSeries.Builder("//CPU//Load").build() + def ts = new StringTimeSeries.Builder("//CPU//Load").build() when: def result = ts.equals(other) @@ -158,13 +158,13 @@ class StraceTimeSeriesTest extends Specification { result == expected where: - other << [null, 1, new StraceTimeSeries.Builder("//CPU//Load").build()] + other << [null, 1, new StringTimeSeries.Builder("//CPU//Load").build()] expected << [false, false, true] } def "test equals same instance"() { given: - def ts = new StraceTimeSeries.Builder("//CPU//Load").build() + def ts = new StringTimeSeries.Builder("//CPU//Load").build() expect: ts.equals(ts) @@ -172,9 +172,9 @@ class StraceTimeSeriesTest extends Specification { def "test hash code"() { given: - def ts = new StraceTimeSeries.Builder("//CPU//Load").build() - def ts2 = new StraceTimeSeries.Builder("//CPU//Load").build() - def ts3 = new StraceTimeSeries.Builder("//CPU//Load//").build() + def ts = new StringTimeSeries.Builder("//CPU//Load").build() + def ts2 = new StringTimeSeries.Builder("//CPU//Load").build() + def ts3 = new StringTimeSeries.Builder("//CPU//Load//").build() expect: ts.hashCode() == ts2.hashCode() @@ -183,7 +183,7 @@ class StraceTimeSeriesTest extends Specification { def "test empty points"() { expect: - def ts = new StraceTimeSeries.Builder("").build() + def ts = new StringTimeSeries.Builder("").build() ts.points().count() == 0l ts.isEmpty() } @@ -196,7 +196,7 @@ class StraceTimeSeriesTest extends Specification { times.add(100 - it as long) values.add(100 - it as String) } - def ts = new StraceTimeSeries.Builder("//CPU//Load").build() + def ts = new StringTimeSeries.Builder("//CPU//Load").build() ts.addAll(times as long[], values as String[]) when: @@ -208,7 +208,7 @@ class StraceTimeSeriesTest extends Specification { def "test attribute reference"() { given: - def ts = new StraceTimeSeries.Builder("//CPU//Load") + def ts = new StringTimeSeries.Builder("//CPU//Load") .attribute("added via builder", "oh dear") .build() when: diff --git a/chronix-kassiopeia-strace/src/test/groovy/de/qaware/chronix/timeseries/dt/StracePointTest.groovy b/chronix-kassiopeia-string/src/test/groovy/de/qaware/chronix/timeseries/dt/StringPointTest.groovy similarity index 70% rename from chronix-kassiopeia-strace/src/test/groovy/de/qaware/chronix/timeseries/dt/StracePointTest.groovy rename to chronix-kassiopeia-string/src/test/groovy/de/qaware/chronix/timeseries/dt/StringPointTest.groovy index dee7f75..f7ef357 100644 --- a/chronix-kassiopeia-strace/src/test/groovy/de/qaware/chronix/timeseries/dt/StracePointTest.groovy +++ b/chronix-kassiopeia-string/src/test/groovy/de/qaware/chronix/timeseries/dt/StringPointTest.groovy @@ -20,11 +20,11 @@ import spock.lang.Specification /** * Unit test for the strace-point class */ -class StracePointTest extends Specification { +class StringPointTest extends Specification { def "test point"() { when: - def pair = new StracePoint(0 as int, 1 as long, 2 as String) + def pair = new StringPoint(0 as int, 1 as long, 2 as String) then: pair.index == 0 @@ -34,32 +34,32 @@ class StracePointTest extends Specification { def "test equals"() { when: - def pair = new StracePoint(0i, 1l, "2") + def pair = new StringPoint(0i, 1l, "2") then: pair.equals(pair) pair.equals(other) == result where: - other << [null, new Object(), new StracePoint(1i, 1l, "2"), new StracePoint(0i, 2l, "2"), new StracePoint(0i, 1l, "3"), new StracePoint(0i, 1l, "2")] + other << [null, new Object(), new StringPoint(1i, 1l, "2"), new StringPoint(0i, 2l, "2"), new StringPoint(0i, 1l, "3"), new StringPoint(0i, 1l, "2")] result << [false, false, false, false, false, true] } def "test hashCode"() { when: - def pair = new StracePoint(0i, 1l, "2") + def pair = new StringPoint(0i, 1l, "2") then: (pair.hashCode() == other.hashCode()) == result where: - other << [new Object(), new StracePoint(1i, 1l, "2"), new StracePoint(0i, 2l, "2"), new StracePoint(0i, 1l, "3"), new StracePoint(0i, 1l, "2")] + other << [new Object(), new StringPoint(1i, 1l, "2"), new StringPoint(0i, 2l, "2"), new StringPoint(0i, 1l, "3"), new StringPoint(0i, 1l, "2")] result << [false, false, false, false, true] } def "test to string"() { expect: - new StracePoint(0i, 1l, "2").toString() + new StringPoint(0i, 1l, "2").toString() } } diff --git a/settings.gradle b/settings.gradle index 4d453a6..a18f553 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,6 +5,6 @@ include 'chronix-kassiopeia' include 'chronix-kassiopeia-simple' include 'chronix-kassiopeia-simple-converter' include 'chronix-kassiopeia-converter-common' -include 'chronix-kassiopeia-strace' -include 'chronix-kassiopeia-converter-strace' +include 'chronix-kassiopeia-string' +include 'chronix-kassiopeia-converter-string'