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 2020/03/01 15:29:46 UTC

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4416: Provide profile exporter tool

wu-sheng commented on a change in pull request #4416: Provide profile exporter tool
URL: https://github.com/apache/skywalking/pull/4416#discussion_r386117138
 
 

 ##########
 File path: tools/profile-exporter/profile_exporter.sh
 ##########
 @@ -0,0 +1,100 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+#
+
+bin_path=$0
+exporter_dir=$(cd $(dirname $0); pwd)
+
+while [[ $# -gt 0 ]]; do
+  case "$1" in
+    --taskid=*)
+      task_id=${1#*=}
+      ;;
+    --traceid=*)
+      trace_id=${1#*=}
+      ;;
+    *)
+      export_path=$1
+  esac
+  shift
+done
+
+[[ ! ${task_id} || ! ${trace_id} || ! ${export_path} ]] \
+  && echo 'Usage: sh tools/profile-exporter/profile_exporter.sh [--taskid] [--traceid] export_path' \
+  && exit 1
+
+[[ ! -d ${export_path} ]] \
+  && echo "Cannot find export export_path path: ${export_path}" \
+  && exit 1
+
+# prepare paths
+config_file="${exporter_dir}/../../config/application.yml"
+oap_libs_dir="${exporter_dir}/../../oap-libs"
+exporter_log_file="${exporter_dir}/profile_exporter_log4j2.xml"
+awk_change_file="${exporter_dir}/persist_core_and_storage.awk"
 
 Review comment:
   Why use `awk`? Using the user changed `application.yml` is very dangerous. We should not count on that. 
   Please use the separated YAML file including the minimal content, only necessary modules and providers. Then, document should be updated by following this change request.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services