-
Notifications
You must be signed in to change notification settings - Fork 941
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[alerter,collector,common,warehouse] refactor auto import component (#…
…576) * [web-app] fix history echarts chart tooltip only show one instance (#365) * [workflow] upgrade issues-translator version 2.7 (#367) * [manger] add mockito unit test * [manger] add globalExceptionHandler mockito unit test (#368) * [manager] impl appController unit test case (#370) * 英文注释的补充 * Supplement of English notes * Supplementary English notes * Supplement of English notes * AppControllerTest Implementation of unit tests Co-authored-by: gaoxingcun <gxc01514416@alibaba-inc.com> * [warehouse] support Iotdb metrics data storage (#372) * add iotdb storage (saveData part) * implement getHistoryMetricData * save multiple instances at the same time implement getHistoryIntervalMetricData * [warehouse] reformat code * [warehouse] refactor code * [warehouse] refactor code * [warehouse] refactor code * [warehouse] fix insert node path container " ' parsed error * [warehouse] fix insert node path container " ' * parsed error * [warehouse] support iotdb rpc-port * support iotdb version 0.12 fix save data and select bug * replace Session with SessionPool * rule fix, 修复魔法值问题 Co-authored-by: tomsun28 <tomsun28@outlook.com> Co-authored-by: hujiaofen <hujiaofen@2dfire.com> * [webapp,warehouse] support historical interval aggregate data chart (#373) * [manger] add mockito unit test * [manger] impl unit test ParamDaoTest #360 * [manager] fix NoticeRuleDaoTest * [manger] impl unit test ParamDefineDaoTest #361 * [manger] impl unit test TagDaoTest #362 * [manger] add manger sql dao mockito unit test (#375) * [manger] add mockito unit test * [manger] add mockito unit test * [manger] impl unit test ParamDaoTest #360 * [manager] fix NoticeRuleDaoTest * [manger] impl unit test ParamDefineDaoTest #361 * [manger] impl unit test TagDaoTest #362 * [manager] I18nControllerTest and MonitorControllerTest Unit tests are written (#376) * I18ControllerTest Completion of the test class * MonitorControllerTest Unit tests are written * [manger] impl unit test AppServiceTest #355 * [hertzbeat] update use PromQL to collect metrics from promethues server (#456) * [manager] enhancement manager-monitors-page added gmtUpdate desc (#455) * [manager-monitors](增强)应用服务检测-网站检测-分页:添加默认name升序 (enhancement)manager-monitors-page added name asc * [manager-monitors](增强)应用服务检测-网站检测-分页:添加默认gmtUpdate降序 (enhancement)manager-monitors-page added gmtUpdate desc * [webapp] support monitors list sort by name, date (#458) * [manager] bugfix the gmtUpdate time not change when update monitor params (#459) * [alerter,collector,common,warehouse] refactor auto import component Co-authored-by: tomsun28 <tomsun28@outlook.com> Co-authored-by: 铁甲小宝 <85919258+TJxiaobao@users.noreply.github.com> Co-authored-by: gaoxingcun <gxc01514416@alibaba-inc.com> Co-authored-by: zcx <48920254+Ceilzcx@users.noreply.github.com> Co-authored-by: hujiaofen <hujiaofen@2dfire.com> Co-authored-by: luxx <58515565+luxx-lq@users.noreply.github.com>
- Loading branch information
1 parent
51cb2ea
commit 4e7ee12
Showing
17 changed files
with
213 additions
and
61 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
alerter/src/main/java/com/usthe/alert/config/AlerterAutoConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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 com.usthe.alert.config; | ||
|
||
import org.springframework.context.annotation.ComponentScan; | ||
|
||
/** | ||
* @author <a href="mailto:gcwm99@gmail.com">gcdd1993</a> | ||
* @version 2.1 | ||
* Created by Musk.Chen on 2023/1/14 | ||
*/ | ||
@ComponentScan(basePackages = "com.usthe.alert") | ||
public class AlerterAutoConfiguration { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
collector/src/main/java/com/usthe/collector/config/CollectorAutoConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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 com.usthe.collector.config; | ||
|
||
import org.springframework.context.annotation.ComponentScan; | ||
|
||
/** | ||
* @author <a href="mailto:gcwm99@gmail.com">gcdd1993</a> | ||
* @version 2.1 | ||
* Created by Musk.Chen on 2023/1/14 | ||
*/ | ||
@ComponentScan(basePackages = "com.usthe.collector") | ||
public class CollectorAutoConfiguration { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
package com.usthe.manager; | ||
|
||
import com.usthe.alert.AlerterProperties; | ||
import com.usthe.alert.AlerterWorkerPool; | ||
import com.usthe.alert.calculate.CalculateAlarm; | ||
import com.usthe.alert.controller.AlertDefineController; | ||
import com.usthe.alert.controller.AlertDefinesController; | ||
import com.usthe.alert.controller.AlertsController; | ||
import com.usthe.alert.service.impl.AlertDefineServiceImpl; | ||
import com.usthe.alert.service.impl.AlertServiceImpl; | ||
import com.usthe.collector.collect.database.JdbcSpiLoader; | ||
import com.usthe.collector.collect.http.promethus.PrometheusParseCreater; | ||
import com.usthe.collector.collect.strategy.CollectStrategyFactory; | ||
import com.usthe.collector.dispatch.CommonDispatcher; | ||
import com.usthe.collector.dispatch.DispatchProperties; | ||
import com.usthe.collector.dispatch.MetricsCollectorQueue; | ||
import com.usthe.collector.dispatch.WorkerPool; | ||
import com.usthe.collector.dispatch.entrance.internal.CollectJobService; | ||
import com.usthe.collector.dispatch.timer.TimerDispatcher; | ||
import com.usthe.collector.dispatch.unit.impl.DataSizeConvert; | ||
import com.usthe.common.config.AviatorConfiguration; | ||
import com.usthe.common.config.CommonConfig; | ||
import com.usthe.common.config.CommonProperties; | ||
import com.usthe.common.queue.impl.InMemoryCommonDataQueue; | ||
import com.usthe.common.service.TencentSmsClient; | ||
import com.usthe.common.support.SpringContextHolder; | ||
import com.usthe.warehouse.WarehouseWorkerPool; | ||
import com.usthe.warehouse.config.WarehouseProperties; | ||
import com.usthe.warehouse.controller.MetricsDataController; | ||
import com.usthe.warehouse.store.HistoryIotDbDataStorage; | ||
import com.usthe.warehouse.store.HistoryTdEngineDataStorage; | ||
import com.usthe.warehouse.store.RealTimeMemoryDataStorage; | ||
import com.usthe.warehouse.store.RealTimeRedisDataStorage; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.NoSuchBeanDefinitionException; | ||
import org.springframework.context.ApplicationContext; | ||
|
||
import javax.annotation.Resource; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
||
/** | ||
* @author <a href="mailto:gcwm99@gmail.com">gcdd1993</a> | ||
* @version 2.1 | ||
* Created by Musk.Chen on 2023/1/14 | ||
*/ | ||
class ManagerTest extends AbstractSpringIntegrationTest { | ||
|
||
@Resource | ||
private ApplicationContext ctx; | ||
|
||
@Test | ||
void testAutoImport() { | ||
// test alert module | ||
assertNotNull(ctx.getBean(AlertDefineServiceImpl.class)); | ||
assertNotNull(ctx.getBean(AlertServiceImpl.class)); | ||
assertNotNull(ctx.getBean(AlertDefineController.class)); | ||
assertNotNull(ctx.getBean(AlerterWorkerPool.class)); | ||
assertNotNull(ctx.getBean(AlerterProperties.class)); | ||
assertNotNull(ctx.getBean(CalculateAlarm.class)); | ||
assertNotNull(ctx.getBean(AlertsController.class)); | ||
assertNotNull(ctx.getBean(AlertDefinesController.class)); | ||
|
||
// test collector module | ||
assertNotNull(ctx.getBean(TimerDispatcher.class)); | ||
assertNotNull(ctx.getBean(CommonDispatcher.class)); | ||
assertNotNull(ctx.getBean(DispatchProperties.class)); | ||
assertNotNull(ctx.getBean(MetricsCollectorQueue.class)); | ||
assertNotNull(ctx.getBean(WorkerPool.class)); | ||
assertNotNull(ctx.getBean(CollectJobService.class)); | ||
assertNotNull(ctx.getBean(JdbcSpiLoader.class)); | ||
assertNotNull(ctx.getBean(PrometheusParseCreater.class)); | ||
assertNotNull(ctx.getBean(DataSizeConvert.class)); | ||
assertNotNull(ctx.getBean(CollectStrategyFactory.class)); | ||
|
||
// test common module | ||
assertNotNull(ctx.getBean(CommonProperties.class)); | ||
assertNotNull(ctx.getBean(CommonConfig.class)); | ||
assertNotNull(ctx.getBean(AviatorConfiguration.class)); | ||
assertNotNull(ctx.getBean(InMemoryCommonDataQueue.class)); | ||
// condition on common.sms.tencent.app-id | ||
assertThrows(NoSuchBeanDefinitionException.class, () -> ctx.getBean(TencentSmsClient.class)); | ||
assertNotNull(ctx.getBean(SpringContextHolder.class)); | ||
|
||
// test warehouse module | ||
assertNotNull(ctx.getBean(WarehouseProperties.class)); | ||
assertNotNull(ctx.getBean(WarehouseWorkerPool.class)); | ||
|
||
// default DataStorage is RealTimeMemoryDataStorage | ||
assertNotNull(ctx.getBean(RealTimeMemoryDataStorage.class)); | ||
assertThrows(NoSuchBeanDefinitionException.class, () -> ctx.getBean(RealTimeRedisDataStorage.class)); | ||
assertThrows(NoSuchBeanDefinitionException.class, () -> ctx.getBean(HistoryTdEngineDataStorage.class)); | ||
assertThrows(NoSuchBeanDefinitionException.class, () -> ctx.getBean(HistoryIotDbDataStorage.class)); | ||
|
||
assertNotNull(ctx.getBean(MetricsDataController.class)); | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
warehouse/src/main/java/com/usthe/warehouse/config/WarehouseAutoConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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 com.usthe.warehouse.config; | ||
|
||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.ComponentScan; | ||
|
||
/** | ||
* @author <a href="mailto:gcwm99@gmail.com">gcdd1993</a> | ||
* @version 2.1 | ||
* Created by Musk.Chen on 2023/1/14 | ||
*/ | ||
@ComponentScan(basePackages = "com.usthe.warehouse") | ||
@EnableConfigurationProperties(WarehouseProperties.class) | ||
public class WarehouseAutoConfiguration { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.