wu-sheng commented on a change in pull request #6183: URL: https://github.com/apache/skywalking/pull/6183#discussion_r568255123
########## File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/event/EventRecord.java ########## @@ -0,0 +1,134 @@ +/* + * 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 com.google.common.base.Joiner; +import java.util.HashMap; +import java.util.Map; +import lombok.Getter; +import lombok.Setter; +import org.apache.skywalking.oap.server.core.Const; +import org.apache.skywalking.oap.server.core.analysis.Stream; +import org.apache.skywalking.oap.server.core.analysis.record.Record; +import org.apache.skywalking.oap.server.core.analysis.worker.RecordStreamProcessor; +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 = EventRecord.INDEX_NAME, scopeId = EVENT, builder = EventRecord.Builder.class, processor = RecordStreamProcessor.class) +public class EventRecord extends Record { Review comment: Based on https://github.com/apache/skywalking/pull/6183#issuecomment-771260649, I want to discuss about, whether should be recognized as `Record` or a `Metric`. As a metric, we could provide ``` @Stream(name = EVENT, scopeId = EVENT, builder = Event.Builder.class, processor = MetricsStreamProcessor.class) @MetricsExtension(supportDownSampling = false, supportUpdate = true) ``` The advantages of being this are, you could write custom `combine`/`merge` logic, and no downsampling, also still available to query manually with new GraphQL. As the merge logic is controlled, rather than record(pure adding), we could ignore(but not reject @BFergerson ) the duplicate UUID events, or duplicate begin or stop commands. ########## File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/event/EventRecord.java ########## @@ -0,0 +1,134 @@ +/* + * 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 com.google.common.base.Joiner; +import java.util.HashMap; +import java.util.Map; +import lombok.Getter; +import lombok.Setter; +import org.apache.skywalking.oap.server.core.Const; +import org.apache.skywalking.oap.server.core.analysis.Stream; +import org.apache.skywalking.oap.server.core.analysis.record.Record; +import org.apache.skywalking.oap.server.core.analysis.worker.RecordStreamProcessor; +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 = EventRecord.INDEX_NAME, scopeId = EVENT, builder = EventRecord.Builder.class, processor = RecordStreamProcessor.class) +public class EventRecord extends Record { Review comment: `@MetricsExtension` is a very tricky thing :P I added it when we adopted the metadata as a kind of metrics. ---------------------------------------------------------------- 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]
