removed edqs stats logs, fixed edqs apiUsage name
This commit is contained in:
parent
61fa0a8dcd
commit
b4898568d1
@ -1757,8 +1757,6 @@ queue:
|
|||||||
stats:
|
stats:
|
||||||
# Enable/disable statistics for EDQS
|
# Enable/disable statistics for EDQS
|
||||||
enabled: "${TB_EDQS_STATS_ENABLED:true}"
|
enabled: "${TB_EDQS_STATS_ENABLED:true}"
|
||||||
# Statistics printing interval for EDQS
|
|
||||||
print-interval-ms: "${TB_EDQS_STATS_PRINT_INTERVAL_MS:300000}"
|
|
||||||
|
|
||||||
vc:
|
vc:
|
||||||
# Default topic name
|
# Default topic name
|
||||||
|
|||||||
@ -289,7 +289,7 @@ public class FieldsUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getText(JsonNode node) {
|
public static String getText(JsonNode node) {
|
||||||
return node != null ? node.asText() : "";
|
return node != null ? node.toString() : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static UUID getCustomerId(CustomerId customerId) {
|
private static UUID getCustomerId(CustomerId customerId) {
|
||||||
|
|||||||
@ -430,6 +430,9 @@ public class TenantRepo {
|
|||||||
|
|
||||||
private String getEntityName(EntityId entityId) {
|
private String getEntityName(EntityId entityId) {
|
||||||
EntityType entityType = entityId.getEntityType();
|
EntityType entityType = entityId.getEntityType();
|
||||||
|
if (entityType == EntityType.TENANT && entityId.getId().equals(TenantId.NULL_UUID)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return switch (entityType) {
|
return switch (entityType) {
|
||||||
case CUSTOMER, TENANT -> getEntityMap(entityType).get(entityId.getId()).getFields().getName();
|
case CUSTOMER, TENANT -> getEntityMap(entityType).get(entityId.getId()).getFields().getName();
|
||||||
default -> throw new RuntimeException("Unsupported entity type: " + entityType);
|
default -> throw new RuntimeException("Unsupported entity type: " + entityType);
|
||||||
|
|||||||
@ -20,7 +20,6 @@ import lombok.Getter;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.thingsboard.server.common.data.ObjectType;
|
import org.thingsboard.server.common.data.ObjectType;
|
||||||
import org.thingsboard.server.common.data.edqs.EdqsEventType;
|
import org.thingsboard.server.common.data.edqs.EdqsEventType;
|
||||||
@ -43,18 +42,6 @@ public class EdqsStatsService {
|
|||||||
private final ConcurrentHashMap<TenantId, EdqsStats> statsMap = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<TenantId, EdqsStats> statsMap = new ConcurrentHashMap<>();
|
||||||
private final StatsFactory statsFactory;
|
private final StatsFactory statsFactory;
|
||||||
|
|
||||||
@Scheduled(initialDelayString = "${queue.edqs.stats.print-interval-ms:300000}",
|
|
||||||
fixedDelayString = "${queue.edqs.stats.print-interval-ms:300000}")
|
|
||||||
private void reportStats() {
|
|
||||||
if (statsMap.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String values = statsMap.entrySet().stream()
|
|
||||||
.map(kv -> "TenantId [" + kv.getKey() + "] stats [" + kv.getValue() + "]")
|
|
||||||
.collect(Collectors.joining(System.lineSeparator()));
|
|
||||||
log.info("EDQS Stats: {}", values);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void reportEvent(TenantId tenantId, ObjectType objectType, EdqsEventType eventType) {
|
public void reportEvent(TenantId tenantId, ObjectType objectType, EdqsEventType eventType) {
|
||||||
statsMap.computeIfAbsent(tenantId, id -> new EdqsStats(tenantId, statsFactory))
|
statsMap.computeIfAbsent(tenantId, id -> new EdqsStats(tenantId, statsFactory))
|
||||||
.reportEvent(objectType, eventType);
|
.reportEvent(objectType, eventType);
|
||||||
|
|||||||
@ -70,8 +70,6 @@ queue:
|
|||||||
stats:
|
stats:
|
||||||
# Enable/disable statistics for EDQS
|
# Enable/disable statistics for EDQS
|
||||||
enabled: "${TB_EDQS_STATS_ENABLED:true}"
|
enabled: "${TB_EDQS_STATS_ENABLED:true}"
|
||||||
# Statistics printing interval for EDQS
|
|
||||||
print-interval-ms: "${TB_EDQS_STATS_PRINT_INTERVAL_MS:300000}"
|
|
||||||
|
|
||||||
kafka:
|
kafka:
|
||||||
# Kafka Bootstrap nodes in "host:port" format
|
# Kafka Bootstrap nodes in "host:port" format
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user