wu-sheng commented on a change in pull request #6183:
URL: https://github.com/apache/skywalking/pull/6183#discussion_r570635036



##########
File path: 
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/event/Event.java
##########
@@ -0,0 +1,231 @@
+/*
+ * 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 org.apache.skywalking.oap.server.core.event;
+
+import java.util.HashMap;
+import java.util.Map;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.skywalking.apm.util.StringUtil;
+import org.apache.skywalking.oap.server.core.analysis.MetricsExtension;
+import org.apache.skywalking.oap.server.core.analysis.Stream;
+import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
+import org.apache.skywalking.oap.server.core.analysis.metrics.Metrics;
+import 
org.apache.skywalking.oap.server.core.analysis.worker.MetricsStreamProcessor;
+import org.apache.skywalking.oap.server.core.remote.grpc.proto.RemoteData;
+import org.apache.skywalking.oap.server.core.source.ScopeDeclaration;
+import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
+import org.apache.skywalking.oap.server.core.storage.annotation.Column;
+
+import static 
org.apache.skywalking.oap.server.core.source.DefaultScopeDefine.EVENT;
+
+@Getter
+@Setter
+@ScopeDeclaration(id = EVENT, name = "Event")
+@Stream(name = Event.INDEX_NAME, scopeId = EVENT, builder = 
Event.Builder.class, processor = MetricsStreamProcessor.class)
+@EqualsAndHashCode(
+    callSuper = false,
+    of = "uuid"
+)
+@MetricsExtension(supportDownSampling = false, supportUpdate = true)
+public class Event extends Metrics {
+
+    public static final String INDEX_NAME = "events";
+
+    public static final String UUID = "uuid";
+
+    public static final String SERVICE = "service";
+
+    public static final String SERVICE_INSTANCE = "service_instance";
+
+    public static final String ENDPOINT = "endpoint";
+
+    public static final String NAME = "name";
+
+    public static final String TYPE = "type";
+
+    public static final String MESSAGE = "message";
+
+    public static final String PARAMETERS = "parameters";
+
+    public static final String START_TIME = "start_time";
+
+    public static final String END_TIME = "end_time";
+
+    @Override
+    public String id() {
+        return getUuid();
+    }
+
+    @Column(columnName = UUID)
+    private String uuid;
+
+    @Column(columnName = SERVICE)
+    private String service;
+
+    @Column(columnName = SERVICE_INSTANCE)
+    private String serviceInstance;
+
+    @Column(columnName = ENDPOINT)
+    private String endpoint;
+
+    @Column(columnName = NAME)
+    private String name;
+
+    @Column(columnName = TYPE)
+    private String type;
+
+    @Column(columnName = MESSAGE)
+    private String message;
+
+    @Column(columnName = PARAMETERS, storageOnly = true)
+    private String parameters;
+
+    @Column(columnName = START_TIME)
+    private long startTime;
+
+    @Column(columnName = END_TIME)
+    private long endTime;
+
+    @Override
+    public boolean combine(final Metrics metrics) {

Review comment:
       Let's update this protocol doc a little to map this logic, 
https://github.com/apache/skywalking-query-protocol/blob/master/event.graphqls#L26-L29




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to