Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check class description #1638

Merged
merged 5 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.springframework.context.annotation.ComponentScan;

/**
*
* Alert auto configuration.
* @version 2.1
*/
@ComponentScan(basePackages = "org.dromara.hertzbeat.alert")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,55 +22,55 @@
import java.util.Map;

/**
* 云服务告警信息的抽象父类
* {@link org.dromara.hertzbeat.common.entity.dto.AlertReport} - 方法与该类参数一一对应,方法含义详情请看该类
* Abstract parent of cloud service alarm information
* {@link org.dromara.hertzbeat.common.entity.dto.AlertReport} - The method corresponds to the parameter of this class one by one. For details about the method, see this class
*/
public abstract class CloudAlertReportAbstract {

/**
* 云告警转为内部告警时的告警名称
* This parameter specifies the alarm name when a cloud alarm is converted to an internal alarm
*/
@JsonIgnore
public abstract String getAlertName();

/**
* 云告警转为内部告警时的告警间隔
* Interval when a cloud alarm is converted to an internal alarm
*/
@JsonIgnore
public abstract Integer getAlertDuration();

/**
* 云告警转为内部告警时的告警时间
* Specifies the alarm time when a cloud alarm is converted to an internal alarm
*/
@JsonIgnore
public abstract long getAlertTime();

/**
* 云告警转为内部告警时的告警严重程度
* Severity of an alarm when a cloud alarm is converted to an internal alarm
*/
@JsonIgnore
public abstract Integer getPriority();

/**
* 云告警转为内部告警时的告警类型
* This parameter specifies the alarm type when a cloud alarm is converted to an internal alarm
*/
@JsonIgnore
public abstract Integer getReportType();

/**
* 云告警转为内部告警时的告警标签信息
* Alarm label information about a cloud alarm that is converted to an internal alarm
*/
@JsonIgnore
public abstract Map<String, String> getLabels();

/**
* 云告警转为内部告警时的告警标注
* Alarm labels when a cloud alarm is converted to an internal alarm
*/
@JsonIgnore
public abstract Map<String, String> getAnnotations();

/**
* 云告警转为内部告警时的告警内容
* This topic describes the alarm content when a cloud alarm is converted to an internal alarm
*/
@JsonIgnore
public abstract String getContent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.dromara.hertzbeat.common.entity.dto.AlertReport;

/**
* 通用云端告警实体类
* Generic cloud alarm entity class
*/
@Data
@AllArgsConstructor
Expand All @@ -32,17 +32,17 @@
public class GeneralCloudAlertReport extends AlertReport {

/**
* 告警日期时间
* Alarm date and time
*/
private String alertDateTime;

/**
* 日期时间格式
* DATE TIME FORMAT
*/
private String dateTimeFormat;

/**
* 可通过增强属性刷新告警时间的时间戳
* You can refresh the timestamp of the alarm time with enhanced properties
*/
public void refreshAlertTime() {
// 有时间戳,取时间戳
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

/**
*
* 腾讯云告警实体类
* Tencent cloud alarm entity class
*/
@Data
@AllArgsConstructor
Expand Down Expand Up @@ -157,18 +157,18 @@ public Map<String, String> getAnnotations() {
}

/**
* 事务告警
* Transaction alarm
*/
private static final String EVENT = "event";

/**
* 指标告警
* Indicator alarm
*/
private static final String METRIC = "metric";

/**
* 如果后续腾讯云告警类型增多的话,可以将该实体类拆分为一个父类和多个子类,然后在子类实现该方法即可
* 由于目前只有两种,暂不进行拆分
* If the following alarm types increase, the entity class can be divided into a parent class and multiple subclasses, and then the method can be implemented in the subclass
* Since there are only two, it will not be split for the time being
*/
@Override
public String getContent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@
import java.util.List;

/**
*
*
* prometheus parse abstract class
* todo: string类型 和 scalar类型 响应格式解析
*/
public abstract class AbstractPrometheusParse {

/**
* 下游节点
* Downstream node
*/
private AbstractPrometheusParse prometheusParse;

Expand All @@ -43,15 +42,15 @@ public AbstractPrometheusParse setInstance(AbstractPrometheusParse prometheusPar
}

/**
* prom响应类型校验:stringmatrixvectorscalar
* prom response type check: string, matrix, vector, scalar
* todo:string、scalar类型响应未实现
* @param responseStr 返回字符串
* @return return
*/
abstract Boolean checkType(String responseStr);

/**
* 解析prom接口响应数据
* Parse the prom interface response data
* @param resp 返回数据
* @param aliasFields alias fields
* @param http httpProtocol
Expand All @@ -61,7 +60,7 @@ abstract void parse(String resp, List<String> aliasFields, HttpProtocol http,
CollectRep.MetricsData.Builder builder);

/**
* 处理prom接口响应数据
* Processing prom interface response data
* @param resp resp
* @param aliasFields alias fields
* @param http http
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.dromara.hertzbeat.collector.collect.http.promethus;

/**
*
* Parse Exception
*
*/
public class ParseException extends RuntimeException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.List;

/**
*
* Prometheus Last Parser
*
*/
@Slf4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
*
*
* 处理prometheus返回类型为“matrix”的响应格式
* Processing prometheus returns a response format of type "matrix"
*/
@NoArgsConstructor
public class PrometheusMatrixParser extends AbstractPrometheusParse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.springframework.stereotype.Component;

/**
*
* prometheus parse creater
*
*/
@Slf4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
*
*
* 处理prometheus返回类型为“vector”的响应格式
* Processing prometheus returns a response format of type "vector"
*/
@NoArgsConstructor
public class PrometheusVectorParser extends AbstractPrometheusParse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
/**
*
*
* 解析prometheus的exporter接口传递的数据 http:xxx/metrics
* 参考: prometheus的text_parse.go的代码, 入口: TextToMetricFamilies
* Resolves the data passed by prometheus's exporter interface http:xxx/metrics
* Reference: prometheus text_parse.go code, entry: TextToMetricFamilies
*/
@Slf4j
public class ExporterParser {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.List;

/**
*
* DiscoveryClient interface
*/
public interface DiscoveryClient extends AutoCloseable {
ConnectConfig buildConnectConfig(HttpsdProtocol httpsdProtocol);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.Objects;

/**
*
* Discovery Client Management
*/
public class DiscoveryClientManagement {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lombok.NoArgsConstructor;

/**
*
* Server Info
*/
@Data
@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import lombok.Data;

/**
*
* Service Instance
*/
@Data
@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import java.util.Objects;

/**
*
* memcached collect
*/
@Slf4j
public class MemcachedCollectImpl extends AbstractCollect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@


/**
*
* NebulaGraph collect
*/
@Slf4j
public class NebulaGraphCollectImpl extends AbstractCollect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import java.util.Objects;

/**
*
* ntp collect
*/
@Slf4j
public class NtpCollectImpl extends AbstractCollect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
/**
*
*
* 解析prometheus的exporter接口传递的数据 http:xxx/metrics
* 参考: prometheus的text_parse.go的代码, 入口: TextToMetricFamilies
* Resolves the data passed by prometheus's exporter interface http:xxx/metrics
* Reference: prometheus text_parse.go code, entry: TextToMetricFamilies
*/
@Slf4j
public class TextParser {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import java.util.Objects;

/**
*
* smtp collect
*/
@Slf4j
public class SmtpCollectImpl extends AbstractCollect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import java.util.Objects;

/**
*
* Websocket Collect
*/
@Slf4j
public class WebsocketCollectImpl extends AbstractCollect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.springframework.context.annotation.ComponentScan;

/**
*
* Collector Auto Configuration
* @version 2.1
* Created by Musk.Chen on 2023/1/14
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/**
* handle collector close message
* 注: 这里会关闭采集任务, 同时断开与Manager的连接
* Note: The collection task is closed and the connection to Manager is disconnected
*/
@Slf4j
public class GoCloseProcessor implements NettyRemotingProcessor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/**
* handle collector offline message
* 注: 这里不关闭与Manager的连接, 只是关闭采集功能
* Note: The connection to Manager is not closed here, only the capture function is turned off
*/
@Slf4j
public class GoOfflineProcessor implements NettyRemotingProcessor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/**
* handle collector online message
* 注: 这里不是重新打开与Manager的连接, 也做不到, 只是重新开启采集功能
* Note: This is not to re-open the connection with Manager, nor can it be done, just to re-open the collection function
*/
@Slf4j
public class GoOnlineProcessor implements NettyRemotingProcessor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/**
* the interface of unit convert
* 单位转换的接口类,处理 org.dromara.hertzbeat.common.entity.job.Metrics#units
* Unit conversion interface classes and deal with mon. Org.dromara.hertzbeat.com entity. The job. The Metrics# units
*
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.apache.commons.lang3.StringUtils;

/**
*
* Dns protocol
*/
@Data
@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.apache.commons.lang3.StringUtils;

/**
*
* Httpsd protocol
*/
@Data
@Builder
Expand Down
Loading
Loading