Browse Source
Merge branch 'master' into adjustments/calculated-fields-04-03
pull/12820/head
Max Petrov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
28 additions and
11 deletions
-
application/src/main/data/upgrade/basic/schema_update.sql
-
common/data/src/main/java/org/thingsboard/server/common/data/tenant/profile/DefaultTenantProfileConfiguration.java
-
ui-ngx/src/app/shared/models/tenant.model.ts
|
|
|
@ -63,4 +63,21 @@ $$; |
|
|
|
|
|
|
|
-- UPDATE SAVE TIME SERIES NODES END |
|
|
|
|
|
|
|
ALTER TABLE api_usage_state ADD COLUMN IF NOT EXISTS version BIGINT DEFAULT 1; |
|
|
|
ALTER TABLE api_usage_state ADD COLUMN IF NOT EXISTS version BIGINT DEFAULT 1; |
|
|
|
|
|
|
|
-- UPDATE TENANT PROFILE CALCULATED FIELD LIMITS START |
|
|
|
|
|
|
|
UPDATE tenant_profile |
|
|
|
SET profile_data = profile_data |
|
|
|
|| jsonb_build_object( |
|
|
|
'configuration', profile_data->'configuration' || jsonb_build_object( |
|
|
|
'maxCalculatedFieldsPerEntity', COALESCE(profile_data->'configuration'->>'maxCalculatedFieldsPerEntity', '5')::bigint, |
|
|
|
'maxArgumentsPerCF', COALESCE(profile_data->'configuration'->>'maxArgumentsPerCF', '10')::bigint, |
|
|
|
'maxDataPointsPerRollingArg', COALESCE(profile_data->'configuration'->>'maxDataPointsPerRollingArg', '1000')::bigint, |
|
|
|
'maxStateSizeInKBytes', COALESCE(profile_data->'configuration'->>'maxStateSizeInKBytes', '32')::bigint, |
|
|
|
'maxSingleValueArgumentSizeInKBytes', COALESCE(profile_data->'configuration'->>'maxSingleValueArgumentSizeInKBytes', '2')::bigint |
|
|
|
) |
|
|
|
) |
|
|
|
WHERE profile_data->'configuration'->>'maxCalculatedFieldsPerEntity' IS NULL; |
|
|
|
|
|
|
|
-- UPDATE TENANT PROFILE CALCULATED FIELD LIMITS END |
|
|
|
|
|
|
|
@ -135,11 +135,11 @@ public class DefaultTenantProfileConfiguration implements TenantProfileConfigura |
|
|
|
|
|
|
|
private double warnThreshold; |
|
|
|
|
|
|
|
private long maxCalculatedFieldsPerEntity; |
|
|
|
private long maxArgumentsPerCF; |
|
|
|
private long maxDataPointsPerRollingArg; |
|
|
|
private long maxStateSizeInKBytes; |
|
|
|
private long maxSingleValueArgumentSizeInKBytes; |
|
|
|
private long maxCalculatedFieldsPerEntity = 5; |
|
|
|
private long maxArgumentsPerCF = 10; |
|
|
|
private long maxDataPointsPerRollingArg = 1000; |
|
|
|
private long maxStateSizeInKBytes = 32; |
|
|
|
private long maxSingleValueArgumentSizeInKBytes = 2; |
|
|
|
|
|
|
|
@Override |
|
|
|
public long getProfileThreshold(ApiUsageRecordKey key) { |
|
|
|
|
|
|
|
@ -156,11 +156,11 @@ export function createTenantProfileConfiguration(type: TenantProfileType): Tenan |
|
|
|
rpcTtlDays: 0, |
|
|
|
queueStatsTtlDays: 0, |
|
|
|
ruleEngineExceptionsTtlDays: 0, |
|
|
|
maxCalculatedFieldsPerEntity: 0, |
|
|
|
maxArgumentsPerCF: 0, |
|
|
|
maxDataPointsPerRollingArg: 0, |
|
|
|
maxStateSizeInKBytes: 0, |
|
|
|
maxSingleValueArgumentSizeInKBytes: 0, |
|
|
|
maxCalculatedFieldsPerEntity: 5, |
|
|
|
maxArgumentsPerCF: 10, |
|
|
|
maxDataPointsPerRollingArg: 1000, |
|
|
|
maxStateSizeInKBytes: 32, |
|
|
|
maxSingleValueArgumentSizeInKBytes: 2, |
|
|
|
calculatedFieldDebugEventsRateLimit: '' |
|
|
|
}; |
|
|
|
configuration = {...defaultConfiguration, type: TenantProfileType.DEFAULT}; |
|
|
|
|