System info improvements
This commit is contained in:
parent
37a5aeb485
commit
a35b3cd6ad
@ -94,8 +94,9 @@ public class DefaultSystemInfoService extends TbApplicationEventListener<Partiti
|
||||
@Override
|
||||
protected void onTbApplicationEvent(PartitionChangeEvent partitionChangeEvent) {
|
||||
if (ServiceType.TB_CORE.equals(partitionChangeEvent.getServiceType())) {
|
||||
boolean myPartition = partitionService.resolve(ServiceType.TB_CORE, TenantId.SYS_TENANT_ID, TenantId.SYS_TENANT_ID).isMyPartition();
|
||||
synchronized (this) {
|
||||
if (partitionService.resolve(ServiceType.TB_CORE, TenantId.SYS_TENANT_ID, TenantId.SYS_TENANT_ID).isMyPartition()) {
|
||||
if (myPartition) {
|
||||
if (scheduler == null) {
|
||||
scheduler = Executors.newSingleThreadScheduledExecutor(ThingsBoardThreadFactory.forName("tb-system-info-scheduler"));
|
||||
scheduler.scheduleAtFixedRate(this::saveCurrentSystemInfo, 0, 1, TimeUnit.MINUTES);
|
||||
|
||||
@ -43,10 +43,10 @@ import org.thingsboard.server.common.data.oauth2.OAuth2ParamsInfo;
|
||||
import org.thingsboard.server.common.data.oauth2.OAuth2RegistrationInfo;
|
||||
import org.thingsboard.server.common.data.oauth2.SchemeType;
|
||||
import org.thingsboard.server.common.data.page.PageData;
|
||||
import org.thingsboard.server.common.data.query.ApiUsageStateFilter;
|
||||
import org.thingsboard.server.common.data.query.EntityCountQuery;
|
||||
import org.thingsboard.server.common.data.query.EntityData;
|
||||
import org.thingsboard.server.common.data.query.EntityTypeFilter;
|
||||
import org.thingsboard.server.common.data.query.SingleEntityFilter;
|
||||
import org.thingsboard.server.common.data.query.TsValue;
|
||||
import org.thingsboard.server.common.data.security.Authority;
|
||||
import org.thingsboard.server.common.stats.TbApiUsageStateClient;
|
||||
@ -227,13 +227,10 @@ public abstract class BaseHomePageApiTest extends AbstractControllerTest {
|
||||
ApiUsageState apiUsageState = apiUsageStateClient.getApiUsageState(TenantId.SYS_TENANT_ID);
|
||||
Assert.assertNotNull(apiUsageState);
|
||||
|
||||
SingleEntityFilter entityFilter = new SingleEntityFilter();
|
||||
entityFilter.setSingleEntity(apiUsageState.getId());
|
||||
|
||||
loginSysAdmin();
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
EntityDataUpdate update = getWsClient().sendEntityDataQuery(entityFilter);
|
||||
EntityDataUpdate update = getWsClient().sendEntityDataQuery(new ApiUsageStateFilter());
|
||||
|
||||
Assert.assertEquals(1, update.getCmdId());
|
||||
PageData<EntityData> pageData = update.getData();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user