You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/07/04 10:45:55 UTC

[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #9299: Add `forEach`, `processRelation` function to MAL Expression, and add `expPrefix` in MAL config

kezhenxu94 commented on code in PR #9299:
URL: https://github.com/apache/skywalking/pull/9299#discussion_r912877558


##########
oap-server/analyzer/meter-analyzer/src/main/java/org/apache/skywalking/oap/meter/analyzer/dsl/registry/ProcessRegistry.java:
##########
@@ -0,0 +1,82 @@
+/*
+ * 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.meter.analyzer.dsl.registry;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.skywalking.oap.meter.analyzer.k8s.K8sInfoRegistry;
+import org.apache.skywalking.oap.server.core.analysis.DownSampling;
+import org.apache.skywalking.oap.server.core.analysis.IDManager;
+import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
+import org.apache.skywalking.oap.server.core.analysis.manual.process.ProcessDetectType;
+import org.apache.skywalking.oap.server.core.analysis.manual.process.ProcessTraffic;
+import org.apache.skywalking.oap.server.core.analysis.worker.MetricsStreamProcessor;
+
+/**
+ * The dynamic entity registry for {@link ProcessTraffic}
+ */
+public class ProcessRegistry {
+
+    public static final String LOCAL_VIRTUAL_PROCESS = "UNKNOWN_LOCAL";
+    public static final String REMOTE_VIRTUAL_PROCESS = "UNKNOWN_REMOTE";
+
+    /**
+     * Generate virtual local process under the instance
+     * @return the process id
+     */
+    public static String generateVirtualLocalProcess(String service, String instance) {
+        return generateVirtualProcess(service, instance, LOCAL_VIRTUAL_PROCESS);
+    }
+
+    /**
+     * Generate virtual remote process under the instance
+     * trying to generate the name in the kubernetes environment through the remote address
+     * @return the process id
+     */
+    public static String generateVirtualRemoteProcess(String service, String instance, String remoteAddress) {
+        // trigger K8sInfoRegistry to start
+        K8sInfoRegistry.getInstance().start();

Review Comment:
   You've added `initExp` but why is this not removed?



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org