Skip to content

Commit

Permalink
* Fix wrong index mode declarations
Browse files Browse the repository at this point in the history
* Remove `@BanyanDB.IndexMode` from TopN implementation, as it's not necessary. Those are records, not metrics.
* Fix, move `Service`, `Instance`, `Endpoint` and `Process` relations out of `index-mode`, as they are time series.
  • Loading branch information
wu-sheng authored Jan 5, 2025
1 parent fcb08ac commit 776a757
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.skywalking.oap.server.core.analysis.manual.cache;

import java.util.Objects;
import lombok.Getter;
import lombok.Setter;
import org.apache.skywalking.oap.server.core.analysis.Stream;
Expand All @@ -31,14 +32,11 @@
import org.apache.skywalking.oap.server.core.storage.type.Convert2Storage;
import org.apache.skywalking.oap.server.core.storage.type.StorageBuilder;

import java.util.Objects;

/**
* Database TopN statement, including Database SQL statement, mongoDB and Redis commands.
*/
@Stream(name = TopNCacheReadCommand.INDEX_NAME, scopeId = DefaultScopeDefine.CACHE_SLOW_ACCESS, builder = TopNCacheReadCommand.Builder.class, processor = TopNStreamProcessor.class)
@BanyanDB.TimestampColumn(TopN.TIMESTAMP)
@BanyanDB.IndexMode
public class TopNCacheReadCommand extends TopN {
public static final String INDEX_NAME = "top_n_cache_read_command";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.skywalking.oap.server.core.analysis.manual.cache;

import java.util.Objects;
import lombok.Getter;
import lombok.Setter;
import org.apache.skywalking.oap.server.core.analysis.Stream;
Expand All @@ -31,14 +32,11 @@
import org.apache.skywalking.oap.server.core.storage.type.Convert2Storage;
import org.apache.skywalking.oap.server.core.storage.type.StorageBuilder;

import java.util.Objects;

/**
* Database TopN statement, including Database SQL statement, mongoDB and Redis commands.
*/
@Stream(name = TopNCacheWriteCommand.INDEX_NAME, scopeId = DefaultScopeDefine.CACHE_SLOW_ACCESS, builder = TopNCacheWriteCommand.Builder.class, processor = TopNStreamProcessor.class)
@BanyanDB.TimestampColumn(TopN.TIMESTAMP)
@BanyanDB.IndexMode
public class TopNCacheWriteCommand extends TopN {
public static final String INDEX_NAME = "top_n_cache_write_command";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.skywalking.oap.server.core.analysis.manual.database;

import java.util.Objects;
import lombok.Getter;
import lombok.Setter;
import org.apache.skywalking.oap.server.core.analysis.Stream;
Expand All @@ -31,14 +32,11 @@
import org.apache.skywalking.oap.server.core.storage.type.Convert2Storage;
import org.apache.skywalking.oap.server.core.storage.type.StorageBuilder;

import java.util.Objects;

/**
* Database TopN statement, including Database SQL statement, mongoDB and Redis commands.
*/
@Stream(name = TopNDatabaseStatement.INDEX_NAME, scopeId = DefaultScopeDefine.DATABASE_SLOW_STATEMENT, builder = TopNDatabaseStatement.Builder.class, processor = TopNStreamProcessor.class)
@BanyanDB.TimestampColumn(TopN.TIMESTAMP)
@BanyanDB.IndexMode
public class TopNDatabaseStatement extends TopN {
public static final String INDEX_NAME = "top_n_database_statement";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
@EqualsAndHashCode(of = {
"entityId"
}, callSuper = true)
@BanyanDB.IndexMode
public class EndpointRelationServerSideMetrics extends Metrics {

public static final String INDEX_NAME = "endpoint_relation_server_side";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
@EqualsAndHashCode(of = {
"entityId"
}, callSuper = true)
@BanyanDB.IndexMode
public class ServiceInstanceRelationClientSideMetrics extends Metrics {

public static final String INDEX_NAME = "service_instance_relation_client_side";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
@EqualsAndHashCode(of = {
"entityId"
}, callSuper = true)
@BanyanDB.IndexMode
public class ServiceInstanceRelationServerSideMetrics extends Metrics {

public static final String INDEX_NAME = "service_instance_relation_server_side";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"entityId",
"component_id"
}, callSuper = true)
@BanyanDB.IndexMode
public class ProcessRelationClientSideMetrics extends Metrics {

public static final String INDEX_NAME = "process_relation_client_side";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
@EqualsAndHashCode(of = {
"entityId"
}, callSuper = true)
@BanyanDB.IndexMode
public class ProcessRelationServerSideMetrics extends Metrics {

public static final String INDEX_NAME = "process_relation_server_side";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
@EqualsAndHashCode(of = {
"entityId"
}, callSuper = true)
@BanyanDB.IndexMode
public class ServiceRelationClientSideMetrics extends Metrics {

public static final String INDEX_NAME = "service_relation_client_side";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
@EqualsAndHashCode(of = {
"entityId"
}, callSuper = true)
@BanyanDB.IndexMode
public class ServiceRelationServerSideMetrics extends Metrics {

public static final String INDEX_NAME = "service_relation_server_side";
Expand Down

0 comments on commit 776a757

Please sign in to comment.