Skip to content

Commit

Permalink
fix: corrected some typos in the project (#492)
Browse files Browse the repository at this point in the history
Co-authored-by: psxjoy <psjxoy@outlook.com>
Co-authored-by: xiaoyu <xiaoyu@apache.org>
  • Loading branch information
3 people authored Oct 24, 2024
1 parent ff0bf90 commit 3e3172c
Show file tree
Hide file tree
Showing 57 changed files with 127 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ public DataSource masterDataSource() throws PropertyVetoException, NamingExcepti
dataSource.setMaxPoolSize(defaultMaxPoolSize);
dataSource.setMinPoolSize(defaultMinPoolSize);

setDatasouce(dataSource);
setDatasource(dataSource);

return dataSource;
}

private void setDatasouce(ComboPooledDataSource dataSource) {
private void setDatasource(ComboPooledDataSource dataSource) {
dataSource.setTestConnectionOnCheckin(true);
dataSource.setTestConnectionOnCheckout(false);
dataSource.setPreferredTestQuery("select 1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class DefaultEnvIpFetch {
private DefaultNacosEnvIpFetch defaultNacosEnvIpFetch;

@Value("${app.ip.fetch.type}")
private String envApppType;
private String envAppType;

@NacosValue(value = "${hera.tpc.url}", autoRefreshed = true)
private String heraTpcUrl;
Expand All @@ -70,7 +70,7 @@ public class DefaultEnvIpFetch {


public EnvIpFetch getEnvIpFetch() {
if (Objects.equals(EnvIpTypeEnum.HTTP.name().toLowerCase(), envApppType)) {
if (Objects.equals(EnvIpTypeEnum.HTTP.name().toLowerCase(), envAppType)) {
return defaultHttpEnvIpFetch;
}
return defaultNacosEnvIpFetch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
@Slf4j
@Service(registry = "registryConfig", interfaceClass = HeraProjectGroupServiceApi.class, group = "${dubbo.group}")
public class HeraPojectGroupServiceImpl implements HeraProjectGroupServiceApi {
public class HeraProjectGroupServiceImpl implements HeraProjectGroupServiceApi {

@Autowired
HeraProjectGroupService projectGroupService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private static TSpanData toTSpanData(String[] array) {
span.setKind(toTKind(spanKind));
span.setEvents(toTEventList(JSONArray.parseArray(decodeLineBreak(array[MessageUtil.EVENTS]))));
span.setTotalRecordedEvents(span.getEventsSize());
span.setResouce(
span.setResource(
toTResource(JSONObject.parseObject(array[MessageUtil.REOUSCES]), specialAttrMap));
span.setExtra(toTExtra(specialAttrMap));
// using links["ref_type=CHILD_OF"] as parent span context and using left as links
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ public Result saveSpacePerm(MilogSpaceDO spaceDO, String account) {
return tpcService.add(nodeAddParam);
}

public Result updateSpaceTpc(MilogSpaceParam param, String accout) {
public Result updateSpaceTpc(MilogSpaceParam param, String account) {
NodeEditParam edit = new NodeEditParam();
edit.setNodeName(param.getSpaceName());
edit.setDesc(param.getDescription());
edit.setOutId(param.getId());
edit.setOutIdType(OutIdTypeEnum.SPACE.getCode());
edit.setAccount(accout);
edit.setAccount(account);
edit.setUserType(UserTypeEnum.CAS_TYPE.getCode());
return tpcService.edit(edit);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class MilogAppMiddlewareRel extends BaseCommon implements Serializable {

@Column(value = "milog_app_id")
@ColDefine(customType = "bigint")
@Comment("milog app talble Primary key Id")
@Comment("milog app table Primary key Id")
private Long milogAppId;

@Column(value = "middleware_id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public interface LogTailService {

void sengMessageToStream(MilogLogTailDo mt, Integer type);

void handleNaocsConfigByMotorRoom(MilogLogTailDo mt, String motorRoomEn, Integer type, Integer projectType);
void handleNacosConfigByMotorRoom(MilogLogTailDo mt, String motorRoomEn, Integer type, Integer projectType);

/**
* Delete a part of a configuration in the configuration center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,12 @@
import org.apache.ozhera.log.manager.common.utils.ManagerUtil;
import org.apache.ozhera.log.manager.common.validation.HeraConfigValid;
import org.apache.ozhera.log.manager.dao.*;
import org.apache.ozhera.log.manager.dao.*;
import org.apache.ozhera.log.manager.mapper.MilogLogSearchSaveMapper;
import org.apache.ozhera.log.manager.mapper.MilogLogTemplateMapper;
import org.apache.ozhera.log.manager.model.bo.LogTailParam;
import org.apache.ozhera.log.manager.model.bo.MlogParseParam;
import org.apache.ozhera.log.manager.model.dto.*;
import org.apache.ozhera.log.manager.model.pojo.*;
import org.apache.ozhera.log.manager.model.dto.*;
import org.apache.ozhera.log.manager.model.pojo.*;
import org.apache.ozhera.log.manager.model.vo.QuickQueryVO;
import org.apache.ozhera.log.manager.service.BaseService;
import org.apache.ozhera.log.manager.service.LogTailService;
Expand Down Expand Up @@ -288,12 +285,12 @@ public void sengMessageToAgent(Long milogAppId, MilogLogTailDo logtailDo) {

@Override
public void sengMessageToStream(MilogLogTailDo mt, Integer type) {
handleNaocsConfigByMotorRoom(mt, MachineRegionEnum.CN_MACHINE.getEn(), type, ProjectTypeEnum.MIONE_TYPE.getCode());
handleNacosConfigByMotorRoom(mt, MachineRegionEnum.CN_MACHINE.getEn(), type, ProjectTypeEnum.MIONE_TYPE.getCode());
}

@Override
public void handleNaocsConfigByMotorRoom(MilogLogTailDo mt, String motorRoomEn, Integer type, Integer projectType) {
milogConfigNacosServiceImpl.chooseCurrentEnvNacosSerevice(motorRoomEn);
public void handleNacosConfigByMotorRoom(MilogLogTailDo mt, String motorRoomEn, Integer type, Integer projectType) {
milogConfigNacosServiceImpl.chooseCurrentEnvNacosService(motorRoomEn);
if (OperateEnum.ADD_OPERATE.getCode().equals(type) || OperateEnum.UPDATE_OPERATE.getCode().equals(type)) {
milogConfigNacosServiceImpl.publishStreamConfig(mt.getSpaceId(), type, projectType, motorRoomEn);
}
Expand All @@ -304,7 +301,7 @@ public void handleNaocsConfigByMotorRoom(MilogLogTailDo mt, String motorRoomEn,
public boolean deleteConfigRemote(Long spaceId, Long id, String motorRoomEn, LogStructureEnum logStructureEnum) {
Assert.notNull(spaceId, "deleteConfigRemote spaceId can not null");
Assert.notNull(id, "deleteConfigRemote id can not null");
milogConfigNacosServiceImpl.chooseCurrentEnvNacosSerevice(motorRoomEn);
milogConfigNacosServiceImpl.chooseCurrentEnvNacosService(motorRoomEn);
if (LogStructureEnum.SPACE == logStructureEnum) {
milogConfigNacosServiceImpl.publishStreamConfig(spaceId, OperateEnum.DELETE_OPERATE.getCode(), null, motorRoomEn);
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ private void assembleLogTemplateDetail(List<LogTemplateDTO> logTemplateDTOList)
@Override
public Result<LogTemplateDetailDTO> getLogTemplateById(long logTemplateId) {
MilogLogTemplateDO logTemplate = milogLogTemplateMapper.selectById(logTemplateId);
MilogLogTemplateDetailDO tmplateDetail = templateDetailMapper.getByTemplateId(logTemplateId);
if (tmplateDetail == null) {
MilogLogTemplateDetailDO templateDetail = templateDetailMapper.getByTemplateId(logTemplateId);
if (templateDetail == null) {
return Result.success(null);
}
LogTemplateDetailDTO dto = MilogLongTemplateDetailConvert.INSTANCE.fromDO(logTemplate, tmplateDetail);
LogTemplateDetailDTO dto = MilogLongTemplateDetailConvert.INSTANCE.fromDO(logTemplate, templateDetail);
return Result.success(dto);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.apache.ozhera.log.manager.domain.EsCluster;
import org.apache.ozhera.log.manager.mapper.MilogLogTemplateMapper;
import org.apache.ozhera.log.manager.model.pojo.*;
import org.apache.ozhera.log.manager.model.pojo.*;
import org.apache.ozhera.log.manager.service.MilogConfigNacosService;
import org.apache.ozhera.log.manager.service.bind.LogTypeProcessor;
import org.apache.ozhera.log.manager.service.bind.LogTypeProcessorFactory;
Expand All @@ -52,7 +51,6 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.ozhera.log.manager.service.nacos.impl.*;
import org.apache.ozhera.log.model.*;

import javax.annotation.Resource;
Expand Down Expand Up @@ -124,7 +122,7 @@ public void init() {
private void initializeNacosConfigurations() {
List<String> regions = commonExtensionService.queryMachineRegions();
for (String region : regions) {
chooseCurrentEnvNacosSerevice(region);
chooseCurrentEnvNacosService(region);
}
}

Expand Down Expand Up @@ -252,7 +250,7 @@ public void publishNameSpaceConfig(String motorRoomEn, Long spaceId, Long storeI
*
* @param motorRoomEn
*/
public void chooseCurrentEnvNacosSerevice(String motorRoomEn) {
public void chooseCurrentEnvNacosService(String motorRoomEn) {
MilogMiddlewareConfig middlewareConfig = milogMiddlewareConfigDao.queryCurrentEnvNacos(motorRoomEn);
if (null != middlewareConfig) {
ConfigService configService = MultipleNacosConfig.getConfigService(middlewareConfig.getNameServer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public PageInfo<Pair<String, String>> queryStreamList(MachinePartitionParam part
}

private MiLogStreamConfig buildMiLogStreamConfig(String machineRoom) {
logConfigNacosService.chooseCurrentEnvNacosSerevice(machineRoom);
logConfigNacosService.chooseCurrentEnvNacosService(machineRoom);
MiLogStreamConfig config = logConfigNacosService.getStreamConfigNacosProvider(machineRoom).getConfig(null);
if (config == null) {
throw new MilogManageException("当前机房nacos配置不存在");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public void pushBean() {
}

@Test
public void caclulate() throws IOException {
public void calculate() throws IOException {
String storeName = "nr-pay";
// dateGroupStrategy.caclulate(storeName);
// dateGroupStrategy.calculate(storeName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void testSyncSpace() {
// LogTailServiceImpl milogLogtailService = Ioc.ins().getBean(LogTailServiceImpl.class);
// MilogLogTailDo mt = new MilogLogTailDo();
// mt.setSpaceId(3L);
// milogLogtailService.handleNaocsConfigByMotorRoom(mt, MachineRegionEnum.CN_MACHINE.getEn(), OperateEnum.ADD_OPERATE.getCode(), ProjectTypeEnum.MIONE_TYPE.getCode());
// milogLogtailService.handleNacosConfigByMotorRoom(mt, MachineRegionEnum.CN_MACHINE.getEn(), OperateEnum.ADD_OPERATE.getCode(), ProjectTypeEnum.MIONE_TYPE.getCode());
// Assert.assertNotNull(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static RocketmqConfig buildRocketmqConfig(String ak, String sk, String cl
config.setNamesrvAddr(StringUtils.isNotEmpty(clusterInfo) ? clusterInfo : ins.get("rocketmq_namesrv_addr", ""));
config.setAk(StringUtils.isNotEmpty(ak) ? ak : ins.get("rocketmq_ak", ""));
config.setSk(StringUtils.isNotEmpty(sk) ? sk : ins.get("rocketmq_sk", ""));
config.setConsumerFromWhere(ins.get("rockermq_consumer_offset", ""));
config.setConsumerFromWhere(ins.get("rocketmq_consumer_offset", ""));
config.setConsumerGroup(Constant.DEFAULT_CONSUMER_GROUP + tag);
if (SinkJobEnum.BACKUP_JOB == jobType) {
config.setConsumerGroup(Constant.DEFAULT_CONSUMER_GROUP + tag + "_" + BACKUP_PREFIX);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public void test2() {
public void test3() {
String regex = "\\bcat\\b";
final String input = "cat cat cat cattie cat";
//Create a Pettern object
//Create a Pattern object
Pattern p = Pattern.compile(regex);
//Create a Pettern object...
//Create a Pattern object...
Matcher m = p.matcher(input);
int count = 0;
if (m.find()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.util.List;

public interface AlertGorupFacade {
public interface AlertGroupFacade {

List<AlertGroupQryInfo> query(String account, String likeName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ public DataSource masterDataSource() throws PropertyVetoException, NamingExcepti
dataSource.setMaxPoolSize(defaultMaxPoolSize);
dataSource.setMinPoolSize(defaultMinPoolSize);

setDatasouce(dataSource);
setDatasource(dataSource);

return dataSource;
}

private void setDatasouce(ComboPooledDataSource dataSource) {
private void setDatasource(ComboPooledDataSource dataSource) {
dataSource.setTestConnectionOnCheckin(true);
dataSource.setTestConnectionOnCheckout(false);
dataSource.setPreferredTestQuery("select 1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public enum AlarmPresetMetrics {
http_client_slow_query("http_client_slow_query","Http调出慢查询", "Http-call-in-slow-query-count",MetricsUnit.UNIT_COUNT, SendAlertGroupKey.APP_METHOD, AlarmStrategyType.INTERFACE,InterfaceMetricTypes.slow_times,BasicUrlType.hera_dash_ip,null),

/**
* metric -dobbo
* metric -dubbo
*/

dubbo_provider_error_times("dubbo_provider_error_times","Dubbo调入异常数", "Dubbo-call-in-exception-count", MetricsUnit.UNIT_COUNT, SendAlertGroupKey.APP_METHOD, AlarmStrategyType.INTERFACE,InterfaceMetricTypes.error_times,BasicUrlType.hera_dash_ip,null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class AlarmHealthResult {
private Integer httpServerAvailability;//httpServer可用性(包括可用性、错误数配置任一) 2分
private Integer httpServerQps;//httpServer qps 1分
private Integer httpServerTimeCost;//httpServer 耗时 1分
private Integer httpClientAvailability;//httpCleint可用性(包括可用性、错误数配置任一) 1分
private Integer httpClientAvailability;//httpClient可用性(包括可用性、错误数配置任一) 1分
private Integer httpClientQps;//httpClient qps 1分
private Integer httpClientTimeCost;//httpClient 耗时 1分
private Integer dubboProviderAvailability;//dubboProvider可用性(包括可用性、错误数配置任一) 2分
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public interface ComputeTimerService {
* @param project
* @param startTime
* @param endTime
* @param timeDurarion
* @param timeDuration
* @param param
*/
AppAlarmData getAppAlarmData(ProjectInfo project, Long startTime, Long endTime, String timeDurarion, Long step,
AppAlarmData getAppAlarmData(ProjectInfo project, Long startTime, Long endTime, String timeDuration, Long step,
AppMonitorRequest param);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface AlarmExprService {

public String getContainerCpuResourceAlarmExpr(Integer projectId,String projectName,String op,double value,boolean isK8s,AlarmRuleData ruleData);

public String getContainerMemReourceAlarmExpr(Integer projectId,String projectName,String op,double value,boolean isK8s,AlarmRuleData ruleData);
public String getContainerMemResourceAlarmExpr(Integer projectId, String projectName, String op, double value, boolean isK8s, AlarmRuleData ruleData);

public Map getEnvIpMapping(Integer projectId, String projectName);
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Result enableRule(Integer alertId,Integer pauseStatus,String identifyId,
return alertManager.enableRule(alertId,pauseStatus,identifyId,user);
}

public Result queryRuels(JsonObject params, String identifyId, String user){
public Result queryRules(JsonObject params, String identifyId, String user){
return alertManager.queryRuels(params,identifyId,user);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ public String getExpr(AppAlarmRule rule, String scrapeIntervel, AlarmRuleData ru
case "container_cpu_resource_use_rate":
return getContainerCpuResourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),false,ruleData);
case "container_mem_resource_use_rate":
return getContainerMemReourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),false,ruleData);
return getContainerMemResourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),false,ruleData);
case "container_disk_use_rate":
return getContainerDiskReourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),false,ruleData);
return getContainerDiskResourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),false,ruleData);

case "k8s_container_cpu_use_rate":
return getContainerCpuAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),true,ruleData);
Expand All @@ -289,7 +289,7 @@ public String getExpr(AppAlarmRule rule, String scrapeIntervel, AlarmRuleData ru
case "k8s_cpu_resource_use_rate":
return getContainerCpuResourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),true,ruleData);
case "k8s_mem_resource_use_rate":
return getContainerMemReourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),true,ruleData);
return getContainerMemResourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),true,ruleData);

case "k8s_cpu_avg_use_rate":
return getK8sCpuAvgUsageAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),ruleData);
Expand Down Expand Up @@ -719,7 +719,7 @@ public String getContainerMemAlarmExpr(Integer projectId,String projectName,Stri
return exprBuilder.toString();
}

public String getContainerMemReourceAlarmExpr(Integer projectId,String projectName,String op,double value,boolean isK8s,AlarmRuleData ruleData){
public String getContainerMemResourceAlarmExpr(Integer projectId, String projectName, String op, double value, boolean isK8s, AlarmRuleData ruleData){

StringBuilder exprBuilder = new StringBuilder();
exprBuilder.append("(sum(avg_over_time(container_memory_rss{");
Expand Down Expand Up @@ -764,11 +764,11 @@ public String getContainerMemReourceAlarmExpr(Integer projectId,String projectNa

exprBuilder.append("}[1d])) by (container_label_PROJECT_ID,application,ip,job,name,system,instance,id,serverEnv,serverZone)) * 100");
exprBuilder.append(op).append(value);
log.info("getContainerMemReourceAlarmExpr param: projectId:{}, projectName:{}, op:{},value:{}, return:{}",projectId, projectName, op,value, exprBuilder.toString());
log.info("getContainerMemResourceAlarmExpr param: projectId:{}, projectName:{}, op:{},value:{}, return:{}",projectId, projectName, op,value, exprBuilder.toString());
return exprBuilder.toString();
}

public String getContainerDiskReourceAlarmExpr(Integer projectId,String projectName,String op,double value,boolean isK8s,AlarmRuleData ruleData){
public String getContainerDiskResourceAlarmExpr(Integer projectId,String projectName,String op,double value,boolean isK8s,AlarmRuleData ruleData){

StringBuilder exprBuilder = new StringBuilder();
exprBuilder.append("clamp_max(sum(container_fs_usage_bytes{");
Expand All @@ -781,7 +781,7 @@ public String getContainerDiskReourceAlarmExpr(Integer projectId,String projectN
exprBuilder.append("application='").append(projectId).append("_").append(projectName.replaceAll("-","_")).append("'");
exprBuilder.append("}) by (application,name,ip,serverEnv)/10737418240 ,1) * 100 ");
exprBuilder.append(op).append(value);
log.info("getContainerDiskReourceAlarmExpr param: projectId:{}, projectName:{}, op:{},value:{}, return:{}",projectId, projectName, op,value, exprBuilder.toString());
log.info("getContainerDiskResourceAlarmExpr param: projectId:{}, projectName:{}, op:{},value:{}, return:{}",projectId, projectName, op,value, exprBuilder.toString());
return exprBuilder.toString();
}

Expand Down
Loading

0 comments on commit 3e3172c

Please sign in to comment.