[GitHub] [skywalking-cli] codecov-io edited a comment on issue #8: Add command manual and documentations

2019-11-09 Thread GitBox
codecov-io edited a comment on issue #8: Add command manual and documentations
URL: https://github.com/apache/skywalking-cli/pull/8#issuecomment-552117647
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=h1) 
Report
   > Merging 
[#8](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=desc) into 
[master](https://codecov.io/gh/apache/skywalking-cli/commit/d2bac71851296b39577b7c5707d4f6c3760b9abb?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking-cli/pull/8/graphs/tree.svg?width=650=oivudZDTNJ=150=pr)](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master   #8   +/-   ##
   ===
 Coverage   51.85%   51.85%   
   ===
 Files   22   
 Lines  54   54   
   ===
 Hits   28   28   
 Misses 22   22   
 Partials44
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=footer). 
Last update 
[d2bac71...db5e96e](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] codecov-io edited a comment on issue #8: Add command manual and documentations

2019-11-09 Thread GitBox
codecov-io edited a comment on issue #8: Add command manual and documentations
URL: https://github.com/apache/skywalking-cli/pull/8#issuecomment-552117647
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=h1) 
Report
   > Merging 
[#8](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=desc) into 
[master](https://codecov.io/gh/apache/skywalking-cli/commit/d2bac71851296b39577b7c5707d4f6c3760b9abb?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking-cli/pull/8/graphs/tree.svg?width=650=oivudZDTNJ=150=pr)](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master   #8   +/-   ##
   ===
 Coverage   51.85%   51.85%   
   ===
 Files   22   
 Lines  54   54   
   ===
 Hits   28   28   
 Misses 22   22   
 Partials44
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=footer). 
Last update 
[d2bac71...db5e96e](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng merged pull request #3820: [agent/plugin] Move FILTER_LENGTH_LIMIT to config.plugin.mongodb

2019-11-09 Thread GitBox
wu-sheng merged pull request #3820: [agent/plugin] Move FILTER_LENGTH_LIMIT to 
config.plugin.mongodb
URL: https://github.com/apache/skywalking/pull/3820
 
 
   


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #3796: Can 'MongoConstants.FILTER_LENGTH_LIMIT' in agent be configable?

2019-11-09 Thread GitBox
wu-sheng commented on issue #3796: Can 'MongoConstants.FILTER_LENGTH_LIMIT' in 
agent be configable?
URL: https://github.com/apache/skywalking/issues/3796#issuecomment-552169157
 
 
   Provided.


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng closed issue #3796: Can 'MongoConstants.FILTER_LENGTH_LIMIT' in agent be configable?

2019-11-09 Thread GitBox
wu-sheng closed issue #3796: Can 'MongoConstants.FILTER_LENGTH_LIMIT' in agent 
be configable?
URL: https://github.com/apache/skywalking/issues/3796
 
 
   


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


With regards,
Apache Git Services


[skywalking] branch master updated: [agent/plugin] Move FILTER_LENGTH_LIMIT to config.plugin.mongodb (#3820)

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
 new 841a9d3  [agent/plugin] Move FILTER_LENGTH_LIMIT to 
config.plugin.mongodb (#3820)
841a9d3 is described below

commit 841a9d395bada2a9f2d883f7ec7f9ed2c4f1027f
Author: zhang-wei 
AuthorDate: Sun Nov 10 15:04:00 2019 +0800

[agent/plugin] Move FILTER_LENGTH_LIMIT to config.plugin.mongodb (#3820)

* move FILTER_LENGTH_LIMIT

* fix checkstyle
---
 .../skywalking/apm/agent/core/conf/Config.java | 13 +--
 .../plugin/mongodb/v3/support/MongoConstants.java  |  2 --
 .../mongodb/v3/support/MongoOperationHelper.java   | 27 ++
 docs/en/setup/service-agent/java-agent/README.md   |  1 +
 4 files changed, 35 insertions(+), 8 deletions(-)

diff --git 
a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java
 
b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java
index 18280df..376add8 100755
--- 
a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java
+++ 
b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java
@@ -19,13 +19,14 @@
 
 package org.apache.skywalking.apm.agent.core.conf;
 
-import java.util.HashMap;
-import java.util.Map;
 import org.apache.skywalking.apm.agent.core.context.trace.TraceSegment;
 import org.apache.skywalking.apm.agent.core.logging.core.LogLevel;
 import org.apache.skywalking.apm.agent.core.logging.core.LogOutput;
 import org.apache.skywalking.apm.agent.core.logging.core.WriterFactory;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * This is the core config in sniffer agent.
  *
@@ -220,6 +221,14 @@ public class Config {
  * include parameters.
  */
 public static boolean TRACE_PARAM = false;
+
+/**
+ * For the sake of performance, SkyWalking won't save the entire 
parameters string into the tag, but only
+ * the first {@code FILTER_LENGTH_LIMIT} characters.
+ *
+ * Set a negative number to save the complete parameter string to 
the tag.
+ */
+public static int FILTER_LENGTH_LIMIT = 256;
 }
 
 public static class Elasticsearch {
diff --git 
a/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/support/MongoConstants.java
 
b/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/support/MongoConstants.java
index 1619057..6230be9 100644
--- 
a/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/support/MongoConstants.java
+++ 
b/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/support/MongoConstants.java
@@ -31,8 +31,6 @@ public class MongoConstants {
 
 public static final String MONGO_DB_OP_PREFIX = "MongoDB/";
 
-public static final int FILTER_LENGTH_LIMIT = 256;
-
 public static final String EMPTY = "";
 
 }
diff --git 
a/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/support/MongoOperationHelper.java
 
b/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/support/MongoOperationHelper.java
index c038cd5..ca1d41e 100644
--- 
a/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/support/MongoOperationHelper.java
+++ 
b/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/support/MongoOperationHelper.java
@@ -23,7 +23,24 @@ import com.mongodb.bulk.DeleteRequest;
 import com.mongodb.bulk.InsertRequest;
 import com.mongodb.bulk.UpdateRequest;
 import com.mongodb.bulk.WriteRequest;
-import com.mongodb.operation.*;
+import com.mongodb.operation.CountOperation;
+import com.mongodb.operation.CreateCollectionOperation;
+import com.mongodb.operation.CreateIndexesOperation;
+import com.mongodb.operation.CreateViewOperation;
+import com.mongodb.operation.DeleteOperation;
+import com.mongodb.operation.DistinctOperation;
+import com.mongodb.operation.FindAndDeleteOperation;
+import com.mongodb.operation.FindAndReplaceOperation;
+import com.mongodb.operation.FindAndUpdateOperation;
+import com.mongodb.operation.FindOperation;
+import com.mongodb.operation.GroupOperation;
+import com.mongodb.operation.InsertOperation;
+import com.mongodb.operation.ListCollectionsOperation;
+import com.mongodb.operation.MapReduceToCollectionOperation;
+import com.mongodb.operation.MapReduceWithInlineResultsOperation;
+import com.mongodb.operation.MixedBulkWriteOperation;
+import 

[GitHub] [skywalking] wu-sheng commented on a change in pull request #3820: [agent/plugin] Move FILTER_LENGTH_LIMIT to config.plugin.mongodb

2019-11-09 Thread GitBox
wu-sheng commented on a change in pull request #3820: [agent/plugin] Move 
FILTER_LENGTH_LIMIT to config.plugin.mongodb
URL: https://github.com/apache/skywalking/pull/3820#discussion_r344475635
 
 

 ##
 File path: 
apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/support/MongoOperationHelper.java
 ##
 @@ -111,7 +128,8 @@ private static String getFilter(List writeRequestList) {
 } else if (request instanceof UpdateRequest) {
 params.append(((UpdateRequest) 
request).getFilter()).append(",");
 }
-if (params.length() > MongoConstants.FILTER_LENGTH_LIMIT) {
+final int filterLengthLimit = 
Config.Plugin.MongoDB.FILTER_LENGTH_LIMIT;
+if (filterLengthLimit > 0 && params.length() > filterLengthLimit) {
 
 Review comment:
   Negative value means all?


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #3820: [agent/plugin] Move FILTER_LENGTH_LIMIT to config.plugin.mongodb

2019-11-09 Thread GitBox
wu-sheng commented on a change in pull request #3820: [agent/plugin] Move 
FILTER_LENGTH_LIMIT to config.plugin.mongodb
URL: https://github.com/apache/skywalking/pull/3820#discussion_r344475635
 
 

 ##
 File path: 
apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/support/MongoOperationHelper.java
 ##
 @@ -111,7 +128,8 @@ private static String getFilter(List writeRequestList) {
 } else if (request instanceof UpdateRequest) {
 params.append(((UpdateRequest) 
request).getFilter()).append(",");
 }
-if (params.length() > MongoConstants.FILTER_LENGTH_LIMIT) {
+final int filterLengthLimit = 
Config.Plugin.MongoDB.FILTER_LENGTH_LIMIT;
+if (filterLengthLimit > 0 && params.length() > filterLengthLimit) {
 
 Review comment:
   Negative value means all?


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] arugal edited a comment on issue #10: [Feature] Support instance list command

2019-11-09 Thread GitBox
arugal edited a comment on issue #10: [Feature] Support instance  list command
URL: https://github.com/apache/skywalking-cli/pull/10#issuecomment-552167518
 
 
   help works like this:
   ```bash
   ./bin/swctl i -h
   
   NAME:
  swctl instance - Instance related sub-command
   
   USAGE:
  swctl instance command [command options] [arguments...]
   
   COMMANDS:
  list, ls  List all available instance by given --service parameter
   
   OPTIONS:
  --help, -h  show help
   
   =
   
   ./bin/swctl i ls -h 
   
   NAME:
  swctl instance list - List all available instance by given --service 
parameter
   
   USAGE:
  swctl instance list [command options] [arguments...]
   
   OPTIONS:
  --start TIME  query start TIME
  --end TIMEquery end TIME
  --service ID  query service ID
   
   ```


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] arugal commented on issue #10: [Feature] Support instance list command

2019-11-09 Thread GitBox
arugal commented on issue #10: [Feature] Support instance  list command
URL: https://github.com/apache/skywalking-cli/pull/10#issuecomment-552167518
 
 
   help works like this:
   ```bash
   ./bin/swctl i ls -h 
   
   NAME:
  swctl instance list - List all available instance by given --service 
parameter
   
   USAGE:
  swctl instance list [command options] [arguments...]
   
   OPTIONS:
  --start TIME  query start TIME
  --end TIMEquery end TIME
  --service ID  query service ID
   
   ```


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal commented on issue #3821: [CLI] Add command instance list to SkyWalking CLI

2019-11-09 Thread GitBox
arugal commented on issue #3821: [CLI] Add command instance list to SkyWalking 
CLI
URL: https://github.com/apache/skywalking/issues/3821#issuecomment-552167316
 
 
   refer https://github.com/apache/skywalking-cli/pull/10


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] codecov-io edited a comment on issue #10: [Feature] Support instance list command

2019-11-09 Thread GitBox
codecov-io edited a comment on issue #10: [Feature] Support instance  list 
command
URL: https://github.com/apache/skywalking-cli/pull/10#issuecomment-552167167
 
 
   # 
[Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=h1) 
Report
   > Merging 
[#10](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=desc) into 
[master](https://codecov.io/gh/apache/skywalking-cli/commit/d2bac71851296b39577b7c5707d4f6c3760b9abb?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking-cli/pull/10/graphs/tree.svg?width=650=oivudZDTNJ=150=pr)](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master  #10   +/-   ##
   ===
 Coverage   51.85%   51.85%   
   ===
 Files   22   
 Lines  54   54   
   ===
 Hits   28   28   
 Misses 22   22   
 Partials44
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=footer).
 Last update 
[d2bac71...677bf3c](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] codecov-io edited a comment on issue #10: [Feature] Support instance list command

2019-11-09 Thread GitBox
codecov-io edited a comment on issue #10: [Feature] Support instance  list 
command
URL: https://github.com/apache/skywalking-cli/pull/10#issuecomment-552167167
 
 
   # 
[Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=h1) 
Report
   > Merging 
[#10](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=desc) into 
[master](https://codecov.io/gh/apache/skywalking-cli/commit/d2bac71851296b39577b7c5707d4f6c3760b9abb?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking-cli/pull/10/graphs/tree.svg?width=650=oivudZDTNJ=150=pr)](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master  #10   +/-   ##
   ===
 Coverage   51.85%   51.85%   
   ===
 Files   22   
 Lines  54   54   
   ===
 Hits   28   28   
 Misses 22   22   
 Partials44
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=footer).
 Last update 
[d2bac71...0afe817](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] codecov-io commented on issue #10: [Feature] Support instance list command

2019-11-09 Thread GitBox
codecov-io commented on issue #10: [Feature] Support instance  list command
URL: https://github.com/apache/skywalking-cli/pull/10#issuecomment-552167167
 
 
   # 
[Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=h1) 
Report
   > Merging 
[#10](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=desc) into 
[master](https://codecov.io/gh/apache/skywalking-cli/commit/d2bac71851296b39577b7c5707d4f6c3760b9abb?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking-cli/pull/10/graphs/tree.svg?width=650=oivudZDTNJ=150=pr)](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master  #10   +/-   ##
   ===
 Coverage   51.85%   51.85%   
   ===
 Files   22   
 Lines  54   54   
   ===
 Hits   28   28   
 Misses 22   22   
 Partials44
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=footer).
 Last update 
[d2bac71...0afe817](https://codecov.io/gh/apache/skywalking-cli/pull/10?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] arugal opened a new pull request #10: [Feature] Support instance list command

2019-11-09 Thread GitBox
arugal opened a new pull request #10: [Feature] Support instance  list command
URL: https://github.com/apache/skywalking-cli/pull/10
 
 
   works like this:
   ```bash
   ./bin/swctl --debug i ls --service=5  --start=2019-11-09 --step=MONTH
   DEBUG Start time: 2019-11-09 end time: 
   DEBUG >> variables: map[duration:{2019-11-09 2019-12-09 DAY} serviceId:5] 
   DEBUG >> query: 
   query ($serviceId: ID!, $duration: Duration!) {
   instances: getServiceInstances(duration: $duration, 
serviceId: $serviceId) {
   id
   name
   language
   instanceUUID
   attributes {
   name
   value
   }
   }
   }

   DEBUG >> headers: map[Accept:[application/json; charset=utf-8] 
Content-Type:[application/json; charset=utf-8]] 
   DEBUG << 
{"data":{"instances":[{"id":"5","name":"projectD-pid:4760@skywalking-server-0001","language":"JAVA","instanceUUID":"5459474cc9864567873793ebd268500a","attributes":[{"name":"os_name","value":"Linux"},{"name":"host_name","value":"skywalking-server-0001"},{"name":"process_no","value":"4760"},{"name":"ipv4s","value":"192.168.252.12"}]}]}}
 
   - id: "5"
 name: projectD-pid:4760@skywalking-server-0001
 attributes:
 - name: os_name
   value: Linux
 - name: host_name
   value: skywalking-server-0001
 - name: process_no
   value: "4760"
 - name: ipv4s
   value: 192.168.252.12
 language: JAVA
 instanceuuid: 5459474cc9864567873793ebd268500a
   
   ```
   


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #3822: Add "Apdex" to OAL

2019-11-09 Thread GitBox
wu-sheng commented on issue #3822: Add "Apdex" to OAL
URL: https://github.com/apache/skywalking/issues/3822#issuecomment-552164590
 
 
   Notice, the appdex threshold should based on dynamic configuration and using 
JSON to provide default or service name based config.


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal commented on issue #3583: Plugin test-cases immigrate plan

2019-11-09 Thread GitBox
arugal commented on issue #3583: Plugin test-cases immigrate plan
URL: https://github.com/apache/skywalking/issues/3583#issuecomment-552164244
 
 
   grpc scenario for me


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


With regards,
Apache Git Services


[GitHub] [skywalking] hanahmily commented on issue #2904: Is it possible to have the function of Apdex

2019-11-09 Thread GitBox
hanahmily commented on issue #2904: Is it possible to have the function of Apdex
URL: https://github.com/apache/skywalking/issues/2904#issuecomment-552163915
 
 
   Add #3822 to address this issue.


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


With regards,
Apache Git Services


[GitHub] [skywalking] hanahmily closed issue #2904: Is it possible to have the function of Apdex

2019-11-09 Thread GitBox
hanahmily closed issue #2904: Is it possible to have the function of Apdex
URL: https://github.com/apache/skywalking/issues/2904
 
 
   


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


With regards,
Apache Git Services


[GitHub] [skywalking] hanahmily opened a new issue #3822: Add "Apdex" to OAL

2019-11-09 Thread GitBox
hanahmily opened a new issue #3822: Add "Apdex" to OAL
URL: https://github.com/apache/skywalking/issues/3822
 
 
   Add "Apdex" to OAL, I will refer to 
"https://docs.newrelic.com/docs/apm/new-relic-apm/apdex/apdex-measure-user-satisfaction;


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal commented on issue #3821: [CLI] Add command instance list to SkyWalking CLI

2019-11-09 Thread GitBox
arugal commented on issue #3821: [CLI] Add command instance list to SkyWalking 
CLI
URL: https://github.com/apache/skywalking/issues/3821#issuecomment-552163590
 
 
   refer #3819


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal opened a new issue #3821: [CLI] Add command instance list to SkyWalking CLI

2019-11-09 Thread GitBox
arugal opened a new issue #3821: [CLI] Add command instance list to SkyWalking 
CLI
URL: https://github.com/apache/skywalking/issues/3821
 
 
   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [ ] Bug
   - [ ] Requirement
   - [x] Feature or performance improvement
   
   Command: ```./swctl --debug instance ls --service=1 --start=2019-11-09 
--step=MONTH```


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal opened a new pull request #3820: [agent/plugin] Move FILTER_LENGTH_LIMIT to config.plugin.mongodb

2019-11-09 Thread GitBox
arugal opened a new pull request #3820: [agent/plugin] Move FILTER_LENGTH_LIMIT 
to config.plugin.mongodb
URL: https://github.com/apache/skywalking/pull/3820
 
 
   Please answer these questions before submitting pull request
   
   - Why submit this pull request?
   - [ ] Bug fix
   - [ ] New feature provided
   - [ ] Improve performance
   
   - Related issues
   #3796 


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] wu-sheng commented on issue #8: Add command manual and documentations

2019-11-09 Thread GitBox
wu-sheng commented on issue #8: Add command manual and documentations
URL: https://github.com/apache/skywalking-cli/pull/8#issuecomment-552161554
 
 
   > have contacted the infra to recheck 
https://issues.apache.org/jira/browse/INFRA-19397
   
   Because you need to select a CI test as required, then update will show up.
   
   > I think both normal "Merge" and "Squash and merge" are enabled, I once 
"Squash and merge" a pull request #3 , and it's default from my side
   
   I will pay attention next time doing merge.


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] kezhenxu94 commented on issue #8: Add command manual and documentations

2019-11-09 Thread GitBox
kezhenxu94 commented on issue #8: Add command manual and documentations
URL: https://github.com/apache/skywalking-cli/pull/8#issuecomment-552161340
 
 
   > You need to set a required CI, than the update could work.
   
   have contacted the infra to recheck 
https://issues.apache.org/jira/browse/INFRA-19397
   
   > Do you open squash merge to instead normal merge? I noticed several PRs 
are merged as default mode
   
   I think both normal "Merge" and "Squash and merge" are enabled, I once 
"Squash and merge" a pull request #3 , and it's default from my side
   
   
![image](https://user-images.githubusercontent.com/15965696/68538785-d756ad80-03b4-11ea-8457-1610e25ea3e9.png)
   


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal commented on a change in pull request #3788: Rabbitmq plugin test migration

2019-11-09 Thread GitBox
arugal commented on a change in pull request #3788: Rabbitmq plugin test 
migration
URL: https://github.com/apache/skywalking/pull/3788#discussion_r344469631
 
 

 ##
 File path: test/plugin/scenarios/rabbitmq-scenario/pom.xml
 ##
 @@ -0,0 +1,131 @@
+
+
+
+http://maven.apache.org/POM/4.0.0;
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+org.apache.skywalking
+rabbitmq-scenario
+5.0.0-2018
+skywalking-rabbitmq-scenario
+
+
+UTF-8
+
+5.4.0
+${test.framework.version}
+
+2.8.1
+2.1.4.RELEASE
+
+
+
+
+com.rabbitmq
+amqp-client
+${test.framework.version}
+
+
+
+org.springframework.boot
+spring-boot-starter
+${spring-boot-version}
+
+
+spring-boot-starter-logging
+org.springframework.boot
+
+
+
+
+org.apache.logging.log4j
+log4j-api
+${log4j.version}
+
+
+org.apache.logging.log4j
+log4j-core
+${log4j.version}
+
+
+org.springframework.boot
+spring-boot-starter-web
+${spring-boot-version}
+
+
+
+
+rabbitmq-scenario
+
+
+org.springframework.boot
+spring-boot-maven-plugin
+1.5.9.RELEASE
+
+
+
+repackage
+
+
+
+
+
+org.apache.maven.plugins
+maven-compiler-plugin
+3.6.0
+
+1.8
+1.8
+${project.build.sourceEncoding}
+
+
+
+org.apache.maven.plugins
+maven-assembly-plugin
+
+
+assemble
+package
+
+single
+
+
+
+
src/main/assembly/assembly.xml
+
+
+
+
+
+
+
+
+
+
+spring-snapshots
+http://repo.spring.io/snapshot
+
+
+spring-milestones
+http://repo.spring.io/milestone
+
+
 
 Review comment:
   missing


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal commented on a change in pull request #3788: Rabbitmq plugin test migration

2019-11-09 Thread GitBox
arugal commented on a change in pull request #3788: Rabbitmq plugin test 
migration
URL: https://github.com/apache/skywalking/pull/3788#discussion_r344469718
 
 

 ##
 File path: 
test/plugin/scenarios/rabbitmq-scenario/src/main/java/org/apache/skywalking/apm/testcase/rabbitmq/controller/CaseController.java
 ##
 @@ -0,0 +1,135 @@
+/*
+ * 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.apm.testcase.rabbitmq.controller;
+
+
+import com.rabbitmq.client.*;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+
+import java.io.IOException;
+
+@RestController
+@RequestMapping("/case")
+@PropertySource("classpath:application.properties")
+public class CaseController {
+
+private Logger logger = LogManager.getLogger(CaseController.class);
+
+
+private static final String USERNAME = "admin";
+
+private static final String PASSWORD = "admin";
+
+@Value(value = "${rabbitmq.host:127.0.0.1}")
+private String brokerUrl;
+
+private static final int PORT = 5672;
+
+private static final  String QUEUE_NAME = "test";
+
+private static final  String MESSAGE = "rabbitmq-testcase";
+
+ConnectionFactory factory;
+
+Connection connection = null;
+
+
+@RequestMapping("/rabbitmq")
+@ResponseBody
+public String rabbitmqCase() throws Exception {
+Channel channel = null;
+
+try{
+factory = new ConnectionFactory();
+logger.info("Using brokerUrl = " + brokerUrl);
+factory.setHost(brokerUrl);
+factory.setPort(PORT);
+factory.setUsername(USERNAME);
+factory.setPassword(PASSWORD);
+
+connection = factory.newConnection();
+
+channel = connection.createChannel();
+channel.queueDeclare(QUEUE_NAME, false, false, false, null);
+AMQP.BasicProperties.Builder propsBuilder = new 
AMQP.BasicProperties.Builder();
+logger.info("Message being published -->"+MESSAGE);
+channel.basicPublish("", QUEUE_NAME, propsBuilder.build(), 
MESSAGE.getBytes("UTF-8"));
+logger.info("Message has been published-->"+MESSAGE);
+
+DeliverCallback deliverCallback = (consumerTag, delivery) -> {
+String message = new String(delivery.getBody(), "UTF-8");
+logger.info("Message received-->"+message);
+};
+channel.basicConsume(QUEUE_NAME, true, deliverCallback, 
consumerTag -> { });
+Thread.sleep(5000);
+logger.info("Message Consumed-->");
+
+}catch (Exception ex){
+logger.error(ex.toString());
+}
+finally {
+if (channel != null) {
+channel.close();
+}
+if (connection != null) {
+connection.close();
+}
 
 Review comment:
   ```java
   if(channel != null){
   try {
   channel.close();
   }catch (Exception e){
   // ignore
   }
   }
   if(connection != null){
   try {
   connection.close();
   }catch (Exception e){
   // ignore
   }
   }
   ```
   It should look like this?


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal commented on a change in pull request #3788: Rabbitmq plugin test migration

2019-11-09 Thread GitBox
arugal commented on a change in pull request #3788: Rabbitmq plugin test 
migration
URL: https://github.com/apache/skywalking/pull/3788#discussion_r344469966
 
 

 ##
 File path: 
test/plugin/scenarios/rabbitmq-scenario/src/main/java/org/apache/skywalking/apm/testcase/rabbitmq/controller/CaseController.java
 ##
 @@ -0,0 +1,135 @@
+/*
+ * 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.apm.testcase.rabbitmq.controller;
+
+
+import com.rabbitmq.client.*;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+
+import java.io.IOException;
+
+@RestController
+@RequestMapping("/case")
+@PropertySource("classpath:application.properties")
+public class CaseController {
+
+private Logger logger = LogManager.getLogger(CaseController.class);
+
+
+private static final String USERNAME = "admin";
+
+private static final String PASSWORD = "admin";
+
+@Value(value = "${rabbitmq.host:127.0.0.1}")
+private String brokerUrl;
+
+private static final int PORT = 5672;
+
+private static final  String QUEUE_NAME = "test";
+
+private static final  String MESSAGE = "rabbitmq-testcase";
+
+ConnectionFactory factory;
+
+Connection connection = null;
+
+
+@RequestMapping("/rabbitmq")
+@ResponseBody
+public String rabbitmqCase() throws Exception {
+Channel channel = null;
+
+try{
+factory = new ConnectionFactory();
+logger.info("Using brokerUrl = " + brokerUrl);
+factory.setHost(brokerUrl);
+factory.setPort(PORT);
+factory.setUsername(USERNAME);
+factory.setPassword(PASSWORD);
+
+connection = factory.newConnection();
+
+channel = connection.createChannel();
+channel.queueDeclare(QUEUE_NAME, false, false, false, null);
+AMQP.BasicProperties.Builder propsBuilder = new 
AMQP.BasicProperties.Builder();
+logger.info("Message being published -->"+MESSAGE);
+channel.basicPublish("", QUEUE_NAME, propsBuilder.build(), 
MESSAGE.getBytes("UTF-8"));
+logger.info("Message has been published-->"+MESSAGE);
+
+DeliverCallback deliverCallback = (consumerTag, delivery) -> {
+String message = new String(delivery.getBody(), "UTF-8");
+logger.info("Message received-->"+message);
+};
+channel.basicConsume(QUEUE_NAME, true, deliverCallback, 
consumerTag -> { });
+Thread.sleep(5000);
 
 Review comment:
   Please remove the ```sleep 5000```.


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal commented on a change in pull request #3788: Rabbitmq plugin test migration

2019-11-09 Thread GitBox
arugal commented on a change in pull request #3788: Rabbitmq plugin test 
migration
URL: https://github.com/apache/skywalking/pull/3788#discussion_r344469617
 
 

 ##
 File path: 
test/plugin/scenarios/rabbitmq-scenario/src/main/java/org/apache/skywalking/apm/testcase/rabbitmq/controller/CaseController.java
 ##
 @@ -0,0 +1,135 @@
+/*
+ * 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.apm.testcase.rabbitmq.controller;
+
+
+import com.rabbitmq.client.*;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+
+import java.io.IOException;
+
+@RestController
+@RequestMapping("/case")
+@PropertySource("classpath:application.properties")
+public class CaseController {
+
+private Logger logger = LogManager.getLogger(CaseController.class);
+
+
+private static final String USERNAME = "admin";
+
+private static final String PASSWORD = "admin";
+
+@Value(value = "${rabbitmq.host:127.0.0.1}")
+private String brokerUrl;
+
+private static final int PORT = 5672;
+
+private static final  String QUEUE_NAME = "test";
+
+private static final  String MESSAGE = "rabbitmq-testcase";
+
+ConnectionFactory factory;
+
+Connection connection = null;
+
 
 Review comment:
   ```factory、connection``` should be a local variable.


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal commented on a change in pull request #3788: Rabbitmq plugin test migration

2019-11-09 Thread GitBox
arugal commented on a change in pull request #3788: Rabbitmq plugin test 
migration
URL: https://github.com/apache/skywalking/pull/3788#discussion_r344469820
 
 

 ##
 File path: 
test/plugin/scenarios/rabbitmq-scenario/src/main/resources/log4j2.xml
 ##
 @@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
 
 Review comment:
   The log level is recommended to be changed to ```WARN```


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #3788: Rabbitmq plugin test migration

2019-11-09 Thread GitBox
wu-sheng commented on issue #3788: Rabbitmq plugin test migration
URL: https://github.com/apache/skywalking/pull/3788#issuecomment-552156046
 
 
   /run agent-plugin-test-2


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng removed a comment on issue #3788: Rabbitmq plugin test migration

2019-11-09 Thread GitBox
wu-sheng removed a comment on issue #3788: Rabbitmq plugin test migration
URL: https://github.com/apache/skywalking/pull/3788#issuecomment-552156046
 
 
   /run agent-plugin-test-2


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng removed a comment on issue #3583: Plugin test-cases immigrate plan

2019-11-09 Thread GitBox
wu-sheng removed a comment on issue #3583: Plugin test-cases immigrate plan
URL: https://github.com/apache/skywalking/issues/3583#issuecomment-552116765
 
 
   @arugal You should update the progress, and add the comment like dubbox 
plugon test.


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng removed a comment on issue #3583: Plugin test-cases immigrate plan

2019-11-09 Thread GitBox
wu-sheng removed a comment on issue #3583: Plugin test-cases immigrate plan
URL: https://github.com/apache/skywalking/issues/3583#issuecomment-552116767
 
 
   @arugal You should update the progress, and add the comment like dubbox 
plugon test.


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] wu-sheng commented on issue #8: Add command manual and documentations

2019-11-09 Thread GitBox
wu-sheng commented on issue #8: Add command manual and documentations
URL: https://github.com/apache/skywalking-cli/pull/8#issuecomment-552149439
 
 
   You need to set a required CI, than the update could work. 
   Do you open squash merge to instead normal merge? I noticed several PRs are 
merged as default mode


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] wu-sheng commented on issue #8: Add command manual and documentations

2019-11-09 Thread GitBox
wu-sheng commented on issue #8: Add command manual and documentations
URL: https://github.com/apache/skywalking-cli/pull/8#issuecomment-552149069
 
 
   Branch update seems not open, as #9 merged by me, but this PR doesn't show 
update button. What is the infra progess of this?


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


With regards,
Apache Git Services


[skywalking-cli] 13/29: Merge pull request #4 from apache/fix/license

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 5d95a06488ac455aa2cb6c0d191daf93961d23f4
Merge: f60a826 d74e098
Author: 吴晟 Wu Sheng 
AuthorDate: Thu Nov 7 08:41:22 2019 +0800

Merge pull request #4 from apache/fix/license

Add missing license header

 Makefile | 19 ---
 cmd/main.go  | 18 ++
 cmd/service.go   | 18 ++
 logger/log.go| 18 ++
 scripts/build| 17 +
 swctl/service/list.go| 18 ++
 swctl/service/service.go | 18 ++
 7 files changed, 123 insertions(+), 3 deletions(-)



[skywalking-cli] branch master updated (6562efe -> d2bac71)

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git.


from 6562efe  Merge pull request #6 from kezhenxu94/feature/graphql-client
 new 1ccb9b9  Extract commonly-used flags for reuse
 new 79165a6  Abstract display layer and support json/yaml/table display 
styles
 new f3ce003  Fix golang lint warnings
 new d2bac71  Merge pull request #9 from kezhenxu94/feature/display-styles

The 29 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 commands/{service/service.go => flags/duration.go} | 30 +---
 commands/service/list.go   | 34 ++
 .../interceptor.go => display/display.go   | 35 ++
 config/config.go => display/json/json.go   | 17 +--
 logger/log.go => display/table/table.go| 41 -
 .../service/service.go => display/yaml/yaml.go | 20 
 go.mod |  1 +
 go.sum |  6 +++
 graphql/client/client.go   |  9 ++--
 swctl/main.go  | 53 ++
 10 files changed, 153 insertions(+), 93 deletions(-)
 copy commands/{service/service.go => flags/duration.go} (57%)
 copy commands/interceptor/interceptor.go => display/display.go (55%)
 rename config/config.go => display/json/json.go (79%)
 copy logger/log.go => display/table/table.go (58%)
 copy commands/service/service.go => display/yaml/yaml.go (80%)



[skywalking-cli] 21/29: Redesign start end time when absent and present

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 364978c8845371241f1823ecc6ae9f14220d94b0
Author: kezhenxu94 
AuthorDate: Sat Nov 9 20:24:28 2019 +0800

Redesign start end time when absent and present
---
 commands/interceptor/duration.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/interceptor/duration.go b/commands/interceptor/duration.go
index 1be9974..88468ec 100644
--- a/commands/interceptor/duration.go
+++ b/commands/interceptor/duration.go
@@ -96,7 +96,7 @@ func ParseDuration(start string, end string) (time.Time, 
time.Time, schema.Step)
if len(start) > 0 && len(end) > 0 {
start, end = AlignPrecision(start, end)
 
-   if step, startTime, err = tryParseTime(start); err != nil {
+   if _, startTime, err = tryParseTime(start); err != nil {
logger.Log.Fatalln("Unsupported time format:", start, 
err)
}
if step, endTime, err = tryParseTime(end); err != nil {



[skywalking-cli] 10/29: Add missing license headers

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit d74e098eb1ef7f4dd1ca1e3d63f85c3fad030e87
Author: kezhenxu94 
AuthorDate: Wed Nov 6 22:38:03 2019 +0800

Add missing license headers
---
 Makefile | 19 ---
 cmd/main.go  | 18 ++
 cmd/service.go   | 18 ++
 logger/log.go| 18 ++
 scripts/build| 17 +
 swctl/service/list.go| 18 ++
 swctl/service/service.go | 18 ++
 7 files changed, 123 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index aa368e7..03d2d59 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,19 @@
-# Example:
-#   make build
-#   make install
+#
+# 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.
+#
 
 .PHONY: build install
 
diff --git a/cmd/main.go b/cmd/main.go
index e4969db..08e105d 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -1,3 +1,21 @@
+/*
+ * 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 main
 
 import (
diff --git a/cmd/service.go b/cmd/service.go
index 36c9e5e..8513965 100644
--- a/cmd/service.go
+++ b/cmd/service.go
@@ -1,3 +1,21 @@
+/*
+ * 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 main
 
 import (
diff --git a/logger/log.go b/logger/log.go
index 039bdec..4a5d482 100644
--- a/logger/log.go
+++ b/logger/log.go
@@ -1,3 +1,21 @@
+/*
+ * 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 logger
 
 import (
diff --git a/scripts/build b/scripts/build
index a60a9cf..2e48690 100755
--- a/scripts/build
+++ b/scripts/build
@@ -1,4 +1,21 @@
 #!/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 

[skywalking-cli] 17/29: Rename

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit f7f99100250e7aaf4b4376ca91eaa032167f8714
Author: kezhenxu94 
AuthorDate: Thu Nov 7 21:54:51 2019 +0800

Rename
---
 graphql/client/client.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/graphql/client/client.go b/graphql/client/client.go
index 10a680a..0b050e3 100644
--- a/graphql/client/client.go
+++ b/graphql/client/client.go
@@ -33,7 +33,7 @@ func Services(duration schema.Duration) []schema.Service {
logger.Log.Debugln(msg)
}
 
-   var services map[string][]schema.Service
+   var response map[string][]schema.Service
request := graphql.NewRequest(`
query ($duration: Duration!) {
services: getAllServices(duration: $duration) {
@@ -42,10 +42,10 @@ func Services(duration schema.Duration) []schema.Service {
}
`)
request.Var("duration", duration)
-   if err := client.Run(ctx, request, ); err != nil {
+   if err := client.Run(ctx, request, ); err != nil {
logger.Log.Fatalln(err)
panic(err)
}
 
-   return services["services"]
+   return response["services"]
 }



[skywalking-cli] 22/29: Polish comments of duration

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 32df1785d83c7e103dfb4a03ac820a816fd7e1e4
Author: kezhenxu94 
AuthorDate: Sat Nov 9 20:57:57 2019 +0800

Polish comments of duration
---
 commands/interceptor/duration.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/commands/interceptor/duration.go b/commands/interceptor/duration.go
index 88468ec..def8e20 100644
--- a/commands/interceptor/duration.go
+++ b/commands/interceptor/duration.go
@@ -73,8 +73,8 @@ func DurationInterceptor(ctx *cli.Context) error {
 
 // ParseDuration parses the `start` and `end` to a triplet, (startTime, 
endTime, step)
 // if --start and --end are both absent, then: start := now - 30min; end := now
-// if --start is given, --end is absent, then: end := now
-// if --start is absent, --end is given, then: start := end - 30min
+// if --start is given, --end is absent, then: end := now + 30 units, where 
unit is the precision of `start`, (hours, minutes, etc.)
+// if --start is absent, --end is given, then: start := end - 30 unis, where 
unit is the precision of `end`, (hours, minutes, etc.)
 // NOTE that when either(both) `start` or `end` is(are) given, there is no 
timezone info
 // in the format, (e.g. 2019-11-09 1001), so they'll be considered as 
UTC-based,
 // and generate the missing `start`(`end`) based on the same timezone, UTC



[skywalking-cli] 03/29: Create NOTICE

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 9cbbdffe423d59880b9236af7cfa7389f4592af9
Author: kezhenxu94 
AuthorDate: Wed Nov 6 21:48:52 2019 +0800

Create NOTICE
---
 NOTICE | 5 +
 1 file changed, 5 insertions(+)

diff --git a/NOTICE b/NOTICE
new file mode 100644
index 000..9617f83
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache SkyWalking
+Copyright 2017-2019 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).



[skywalking-cli] 23/29: Polish if-else branches

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 5535cc7de9241090d86a817d2f4ea0c6081aafb9
Author: kezhenxu94 
AuthorDate: Sat Nov 9 21:58:53 2019 +0800

Polish if-else branches
---
 commands/interceptor/duration.go | 14 ++
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/commands/interceptor/duration.go b/commands/interceptor/duration.go
index def8e20..4207011 100644
--- a/commands/interceptor/duration.go
+++ b/commands/interceptor/duration.go
@@ -104,27 +104,17 @@ func ParseDuration(start string, end string) (time.Time, 
time.Time, schema.Step)
}
 
return startTime, endTime, step
-   }
-
-   // end is absent
-   if len(end) == 0 {
+   } else if len(end) <= 0 { // end is absent
if step, startTime, err = tryParseTime(start); err != nil {
logger.Log.Fatalln("Unsupported time format:", start, 
err)
}
return startTime, startTime.Add(30 * stepDuration[step]), step
-   }
-
-   // start is present
-   if len(start) == 0 {
+   } else { // start is present
if step, endTime, err = tryParseTime(end); err != nil {
logger.Log.Fatalln("Unsupported time format:", end, err)
}
return endTime.Add(-30 * stepDuration[step]), endTime, step
}
-
-   logger.Log.Fatalln("Should never happen")
-
-   return startTime, endTime, step
 }
 
 // AlignPrecision aligns the two time strings to same precision



[skywalking-cli] 08/29: Merge pull request #2 from apache/kezhenxu94-patch-2

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 265b188aeb22583ab4467069095455e586bda68b
Merge: 4e660c9 c23eea0
Author: 吴晟 Wu Sheng 
AuthorDate: Wed Nov 6 22:13:09 2019 +0800

Merge pull request #2 from apache/kezhenxu94-patch-2

Set up GitHub Action for PR and push

 .github/workflows/go.yml | 44 
 1 file changed, 44 insertions(+)



[skywalking-cli] 02/29: Add license file

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 866e17f0f611c3540724fce31b3b1fdd62e19598
Author: kezhenxu94 
AuthorDate: Wed Nov 6 21:43:56 2019 +0800

Add license file
---
 LICENSE | 201 
 1 file changed, 201 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..79342a6
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+   Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+  "License" shall mean the terms and conditions for use, reproduction,
+  and distribution as defined by Sections 1 through 9 of this document.
+
+  "Licensor" shall mean the copyright owner or entity authorized by
+  the copyright owner that is granting the License.
+
+  "Legal Entity" shall mean the union of the acting entity and all
+  other entities that control, are controlled by, or are under common
+  control with that entity. For the purposes of this definition,
+  "control" means (i) the power, direct or indirect, to cause the
+  direction or management of such entity, whether by contract or
+  otherwise, or (ii) ownership of fifty percent (50%) or more of the
+  outstanding shares, or (iii) beneficial ownership of such entity.
+
+  "You" (or "Your") shall mean an individual or Legal Entity
+  exercising permissions granted by this License.
+
+  "Source" form shall mean the preferred form for making modifications,
+  including but not limited to software source code, documentation
+  source, and configuration files.
+
+  "Object" form shall mean any form resulting from mechanical
+  transformation or translation of a Source form, including but
+  not limited to compiled object code, generated documentation,
+  and conversions to other media types.
+
+  "Work" shall mean the work of authorship, whether in Source or
+  Object form, made available under the License, as indicated by a
+  copyright notice that is included in or attached to the work
+  (an example is provided in the Appendix below).
+
+  "Derivative Works" shall mean any work, whether in Source or Object
+  form, that is based on (or derived from) the Work and for which the
+  editorial revisions, annotations, elaborations, or other modifications
+  represent, as a whole, an original work of authorship. For the purposes
+  of this License, Derivative Works shall not include works that remain
+  separable from, or merely link (or bind by name) to the interfaces of,
+  the Work and Derivative Works thereof.
+
+  "Contribution" shall mean any work of authorship, including
+  the original version of the Work and any modifications or additions
+  to that Work or Derivative Works thereof, that is intentionally
+  submitted to Licensor for inclusion in the Work by the copyright owner
+  or by an individual or Legal Entity authorized to submit on behalf of
+  the copyright owner. For the purposes of this definition, "submitted"
+  means any form of electronic, verbal, or written communication sent
+  to the Licensor or its representatives, including but not limited to
+  communication on electronic mailing lists, source code control systems,
+  and issue tracking systems that are managed by, or on behalf of, the
+  Licensor for the purpose of discussing and improving the Work, but
+  excluding communication that is conspicuously marked or otherwise
+  designated in writing by the copyright owner as "Not a Contribution."
+
+  "Contributor" shall mean Licensor and any individual or Legal Entity
+  on behalf of whom a Contribution has been received by Licensor and
+  subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+  this License, each Contributor hereby grants to You a perpetual,
+  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+  copyright license to reproduce, prepare Derivative Works of,
+  publicly display, publicly perform, sublicense, and distribute the
+  Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+  this License, each Contributor hereby grants to You a perpetual,
+  worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+  (except as stated in this section) patent license to make, have made,
+  use, offer to sell, sell, import, and otherwise transfer the Work,
+  where such license applies only to those patent claims licensable
+  by such 

[skywalking-cli] 29/29: Merge pull request #9 from kezhenxu94/feature/display-styles

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit d2bac71851296b39577b7c5707d4f6c3760b9abb
Merge: 6562efe f3ce003
Author: 吴晟 Wu Sheng 
AuthorDate: Sun Nov 10 08:05:19 2019 +0800

Merge pull request #9 from kezhenxu94/feature/display-styles

[Feature] Support multiple display styles, JSON, YAML, ASCII Table

 .../client/client.go => commands/flags/duration.go | 51 ++---
 commands/service/list.go   | 34 ++
 config/config.go => display/display.go | 33 --
 config/config.go => display/json/json.go   | 17 +--
 config/config.go => display/table/table.go | 38 ++--
 config/config.go => display/yaml/yaml.go   | 17 +--
 go.mod |  1 +
 go.sum |  6 +++
 graphql/client/client.go   |  9 ++--
 swctl/main.go  | 53 ++
 10 files changed, 165 insertions(+), 94 deletions(-)



[skywalking-cli] 15/29: Merge remote-tracking branch 'apache/master' into feature/graphql-client

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 8244ed863e4dfc791c5c79b2d7ae469a1efdbbf1
Merge: 298aff8 5d95a06
Author: kezhenxu94 
AuthorDate: Thu Nov 7 19:06:44 2019 +0800

Merge remote-tracking branch 'apache/master' into feature/graphql-client

 cmd/main.go  | 50 
 cmd/service.go   | 42 
 swctl/service/list.go| 23 ++
 swctl/service/service.go | 42 
 4 files changed, 157 insertions(+)



[skywalking-cli] 01/29: Initialization project

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit a289a59a2f3b62cbfe3e084f16081bec5b1a7090
Author: heyanlong 
AuthorDate: Wed Nov 6 12:05:58 2019 +0800

Initialization project
---
 .gitignore   |  2 ++
 Makefile |  9 +
 README.md|  6 ++
 cmd/main.go  | 32 
 cmd/service.go   | 24 
 go.mod   |  9 +
 go.sum   | 22 ++
 logger/log.go| 20 
 scripts/build| 11 +++
 swctl/service/list.go|  5 +
 swctl/service/service.go | 24 
 11 files changed, 164 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..25c3120
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.idea
+bin
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 000..aa368e7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,9 @@
+# Example:
+#   make build
+#   make install
+
+.PHONY: build install
+
+build:
+   GO_BUILD_FLAGS="-v" ./scripts/build
+   ./bin/swctl --version
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 000..eaf2c6a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,6 @@
+Apache SkyWalking CLI
+===
+
+http://skywalking.apache.org/assets/logo.svg; alt="Sky Walking logo" 
height="90px" align="right" />
+
+The CLI for [Apache SkyWalking](https://github.com/apache/skywalking).
\ No newline at end of file
diff --git a/cmd/main.go b/cmd/main.go
new file mode 100644
index 000..e4969db
--- /dev/null
+++ b/cmd/main.go
@@ -0,0 +1,32 @@
+package main
+
+import (
+   "os"
+
+   "github.com/sirupsen/logrus"
+   "github.com/urfave/cli"
+
+   "github.com/apache/skywalking-cli/logger"
+)
+
+var log *logrus.Logger
+
+func init() {
+   log = logger.Log
+}
+
+func main() {
+   app := cli.NewApp()
+   app.Flags = []cli.Flag{
+   cli.StringFlag{
+   Name:  "config, c",
+   Usage: "path of settings.yml config. Use the file in 
the same folder as default.",
+   },
+   }
+   app.Commands = []cli.Command{serviceCmd}
+
+   err := app.Run(os.Args)
+   if err != nil {
+   log.Fatal(err)
+   }
+}
diff --git a/cmd/service.go b/cmd/service.go
new file mode 100644
index 000..36c9e5e
--- /dev/null
+++ b/cmd/service.go
@@ -0,0 +1,24 @@
+package main
+
+import (
+   "github.com/apache/skywalking-cli/swctl/service"
+   "github.com/urfave/cli"
+)
+
+var serviceCmd = cli.Command{
+   Name: "service",
+   Flags: []cli.Flag{
+   cli.BoolFlag{
+   Name:  "list",
+   Usage: "list all available services.",
+   },
+   },
+   Action: func(c *cli.Context) {
+   ctl := service.NewService(c)
+
+   err := ctl.Exec()
+   if err != nil {
+   log.Fatal(err)
+   }
+   },
+}
diff --git a/go.mod b/go.mod
new file mode 100644
index 000..8d79e73
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,9 @@
+module github.com/apache/skywalking-cli
+
+go 1.13
+
+require (
+   github.com/lytics/logrus v0.0.0-20170528191427-4389a17ed024 // indirect
+   github.com/sirupsen/logrus v1.4.2
+   github.com/urfave/cli v1.22.1
+)
diff --git a/go.sum b/go.sum
new file mode 100644
index 000..7860264
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,22 @@
+github.com/BurntSushi/toml v0.3.1/go.mod 
h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d 
h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
+github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod 
h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
+github.com/davecgh/go-spew v1.1.1/go.mod 
h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod 
h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/lytics/logrus v0.0.0-20170528191427-4389a17ed024 
h1:QaKVrqyQRNPbdBNCpiU0Ei3iDQko3qoiUUXMiTWhzZM=
+github.com/lytics/logrus v0.0.0-20170528191427-4389a17ed024/go.mod 
h1:SkQviJ2s7rFyzyuxdVp6osZceHOabU91ZhKsEXF0RWg=
+github.com/pmezard/go-difflib v1.0.0/go.mod 
h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/russross/blackfriday/v2 v2.0.1 
h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
+github.com/russross/blackfriday/v2 v2.0.1/go.mod 
h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/shurcooL/sanitized_anchor_name v1.0.0 
h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
+github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod 
h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=

[skywalking-cli] 19/29: Set up test coverage

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit d30b61df54c3229cbe3c385d946451deded0839e
Author: kezhenxu94 
AuthorDate: Sat Nov 9 12:55:16 2019 +0800

Set up test coverage
---
 .github/workflows/go.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index de9ad27..a8677f8 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -48,7 +48,7 @@ jobs:
   - name: Test
 run: |
   go test ./... -coverprofile=coverage.txt -covermode=atomic
-  bash <(curl -s https://codecov.io/bash)
+  CODECOV_TOKEN="a5af28a3-92a2-4b35-9a77-54ad99b1ae00" bash <(curl -s 
https://codecov.io/bash)
 
   - name: Build
 run: make clean && make



[skywalking-cli] 14/29: Motivation:

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 298aff8b4cd0fe3d3c432d569eb29c47a8da2a6e
Author: kezhenxu94 
AuthorDate: Thu Nov 7 19:05:13 2019 +0800

Motivation:

Set up the graphql client, schema and implement a service command
for reference

Modifications:

- Set up GraphQL client
- Implement service ls command

Result:

GraphQL client can be reused by other commands
---
 .asf.yaml   |  17 +
 .github/workflows/go.yml|  32 +-
 Makefile|  24 +-
 cmd/main.go |  32 --
 cmd/service.go  |  24 --
 commands/interceptor.go |  71 +
 commands/model.go   |  49 +++
 commands/service/list.go|  73 +
 commands/service/service.go |  32 ++
 config/config.go|  25 ++
 go.mod  |   3 +-
 go.sum  |   5 +
 graphql/client/client.go|  51 +++
 graphql/schema/schema.go| 750 
 logger/log.go   |  18 ++
 scripts/build   |  19 +-
 swctl/main.go   |  86 +
 swctl/service/list.go   |   5 -
 swctl/service/service.go|  24 --
 19 files changed, 1233 insertions(+), 107 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index 3f2645a..c1f6dfa 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -1,3 +1,20 @@
+#
+# 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.
+#
+
 github:
   description: Apache SkyWalking CLI
   homepage: https://skywalking.apache.org/
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index bdc008c..1abc12e 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -23,22 +23,22 @@ jobs:
 runs-on: ubuntu-latest
 steps:
 
-- name: Set up Go 1.13
-  uses: actions/setup-go@v1
-  with:
-go-version: 1.13
-  id: go
+  - name: Set up Go 1.13
+uses: actions/setup-go@v1
+with:
+  go-version: 1.13
+id: go
 
-- name: Check out code into the Go module directory
-  uses: actions/checkout@v1
+  - name: Check out code into the Go module directory
+uses: actions/checkout@v1
 
-- name: Get dependencies
-  run: |
-go get -v -t -d ./...
-if [ -f Gopkg.toml ]; then
-curl 
https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
-dep ensure
-fi
+  - name: Get dependencies
+run: |
+  go get -v -t -d ./...
+  if [ -f Gopkg.toml ]; then
+  curl 
https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
+  dep ensure
+  fi
 
-- name: Build
-  run: make
+  - name: Build
+run: make
diff --git a/Makefile b/Makefile
index aa368e7..3273175 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,25 @@
-# Example:
-#   make build
-#   make install
+#
+# 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.
+#
 
 .PHONY: build install
 
 build:
GO_BUILD_FLAGS="-v" ./scripts/build
-   ./bin/swctl --version
\ No newline at end of file
+   ./bin/swctl --version
+
+clean:
+   -rm -rf ./bin
\ No newline at end of file
diff --git a/cmd/main.go b/cmd/main.go
deleted file mode 100644
index e4969db..000
--- a/cmd/main.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package main
-
-import (
-   "os"
-
-   

[skywalking-cli] 24/29: Fix typo

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit c8eb90b64f2765cd13ea84b6932c5f3c571f58ba
Author: kezhenxu94 
AuthorDate: Sat Nov 9 21:59:31 2019 +0800

Fix typo
---
 commands/interceptor/duration.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/interceptor/duration.go b/commands/interceptor/duration.go
index 4207011..acd1d67 100644
--- a/commands/interceptor/duration.go
+++ b/commands/interceptor/duration.go
@@ -109,7 +109,7 @@ func ParseDuration(start string, end string) (time.Time, 
time.Time, schema.Step)
logger.Log.Fatalln("Unsupported time format:", start, 
err)
}
return startTime, startTime.Add(30 * stepDuration[step]), step
-   } else { // start is present
+   } else { // start is absent
if step, endTime, err = tryParseTime(end); err != nil {
logger.Log.Fatalln("Unsupported time format:", end, err)
}



[skywalking-cli] 18/29: Set up CI flow

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 8d4c95f758cf7cce163119cb2656b04ad5849824
Author: kezhenxu94 
AuthorDate: Sat Nov 9 12:34:35 2019 +0800

Set up CI flow
---
 .github/workflows/go.yml   |  12 +-
 commands/interceptor.go|  71 
 commands/interceptor/duration.go   | 121 +
 commands/interceptor/duration_test.go  |  98 +
 .../log.go => commands/interceptor/interceptor.go  |  25 ++---
 commands/{model.go => model/step.go}   |   5 +-
 commands/service/list.go   |  24 ++--
 config/config.go   |   2 +-
 go.mod |   1 +
 graphql/client/client.go   |   2 +-
 logger/log.go  |   4 +-
 swctl/main.go  |  14 +--
 commands/model.go => util/io.go|  39 +++
 13 files changed, 287 insertions(+), 131 deletions(-)

diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 1abc12e..de9ad27 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -40,5 +40,15 @@ jobs:
   dep ensure
   fi
 
+  - name: Lint
+run: |
+  curl -sfL 
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh 
-s -- -b $(go env GOPATH)/bin v1.21.0
+  $(go env GOPATH)/bin/golangci-lint run -v ./...
+
+  - name: Test
+run: |
+  go test ./... -coverprofile=coverage.txt -covermode=atomic
+  bash <(curl -s https://codecov.io/bash)
+
   - name: Build
-run: make
+run: make clean && make
diff --git a/commands/interceptor.go b/commands/interceptor.go
deleted file mode 100644
index 6837529..000
--- a/commands/interceptor.go
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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 commands
-
-import (
-   "github.com/apache/skywalking-cli/graphql/schema"
-   "github.com/apache/skywalking-cli/logger"
-   "github.com/urfave/cli"
-   "time"
-)
-
-// Convenient function to chain up multiple cli.BeforeFunc
-func BeforeChain(beforeFunctions []cli.BeforeFunc) cli.BeforeFunc {
-   return func(ctx *cli.Context) error {
-   for _, beforeFunc := range beforeFunctions {
-   if err := beforeFunc(ctx); err != nil {
-   return err
-   }
-   }
-   return nil
-   }
-}
-
-var StepFormats = map[schema.Step]string{
-   schema.StepMonth:  "2006-01-02",
-   schema.StepDay:"2006-01-02",
-   schema.StepHour:   "2006-01-02 15",
-   schema.StepMinute: "2006-01-02 1504",
-   schema.StepSecond: "2006-01-02 1504",
-}
-
-// Set the duration if not set, and format it according to
-// the given step
-func SetUpDuration(ctx *cli.Context) error {
-   step := ctx.Generic("step").(*StepEnumValue).Selected
-   end := ctx.String("end")
-   if len(end) == 0 {
-   end = time.Now().Format(StepFormats[step])
-   logger.Log.Debugln("Missing --end, defaults to", end)
-   if err := ctx.Set("end", end); err != nil {
-   return err
-   }
-   }
-
-   start := ctx.String("start")
-   if len(start) == 0 {
-   start = time.Now().Add(-15 * 
time.Minute).Format(StepFormats[step])
-   logger.Log.Debugln("Missing --start, defaults to", start)
-   if err := ctx.Set("start", start); err != nil {
-   return err
-   }
-   }
-
-   return nil
-}
diff --git a/commands/interceptor/duration.go b/commands/interceptor/duration.go
new file mode 100644
index 000..55c4b86
--- /dev/null
+++ b/commands/interceptor/duration.go
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file 

[GitHub] [skywalking-cli] wu-sheng merged pull request #9: [Feature] Support multiple display styles, JSON, YAML, ASCII Table

2019-11-09 Thread GitBox
wu-sheng merged pull request #9: [Feature] Support multiple display styles, 
JSON, YAML, ASCII Table
URL: https://github.com/apache/skywalking-cli/pull/9
 
 
   


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


With regards,
Apache Git Services


[skywalking-cli] 16/29: Remove stale files

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 5223581e0fdcc973b46efa18f6628f9c72024ee6
Author: kezhenxu94 
AuthorDate: Thu Nov 7 19:11:15 2019 +0800

Remove stale files
---
 cmd/main.go  | 50 
 cmd/service.go   | 42 
 swctl/service/list.go| 23 --
 swctl/service/service.go | 42 
 4 files changed, 157 deletions(-)

diff --git a/cmd/main.go b/cmd/main.go
deleted file mode 100644
index 08e105d..000
--- a/cmd/main.go
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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 main
-
-import (
-   "os"
-
-   "github.com/sirupsen/logrus"
-   "github.com/urfave/cli"
-
-   "github.com/apache/skywalking-cli/logger"
-)
-
-var log *logrus.Logger
-
-func init() {
-   log = logger.Log
-}
-
-func main() {
-   app := cli.NewApp()
-   app.Flags = []cli.Flag{
-   cli.StringFlag{
-   Name:  "config, c",
-   Usage: "path of settings.yml config. Use the file in 
the same folder as default.",
-   },
-   }
-   app.Commands = []cli.Command{serviceCmd}
-
-   err := app.Run(os.Args)
-   if err != nil {
-   log.Fatal(err)
-   }
-}
diff --git a/cmd/service.go b/cmd/service.go
deleted file mode 100644
index 8513965..000
--- a/cmd/service.go
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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 main
-
-import (
-   "github.com/apache/skywalking-cli/swctl/service"
-   "github.com/urfave/cli"
-)
-
-var serviceCmd = cli.Command{
-   Name: "service",
-   Flags: []cli.Flag{
-   cli.BoolFlag{
-   Name:  "list",
-   Usage: "list all available services.",
-   },
-   },
-   Action: func(c *cli.Context) {
-   ctl := service.NewService(c)
-
-   err := ctl.Exec()
-   if err != nil {
-   log.Fatal(err)
-   }
-   },
-}
diff --git a/swctl/service/list.go b/swctl/service/list.go
deleted file mode 100644
index 431032f..000
--- a/swctl/service/list.go
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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 service
-
-func (s *service) showList() error {
-   return nil
-}
diff --git a/swctl/service/service.go b/swctl/service/service.go
deleted file mode 100644
index 

[skywalking-cli] 28/29: Fix golang lint warnings

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit f3ce003c1e307386a6a62ce85f35d4a416472a8e
Author: kezhenxu94 
AuthorDate: Sun Nov 10 03:20:24 2019 +0800

Fix golang lint warnings
---
 display/display.go | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/display/display.go b/display/display.go
index 3d54f6b..0b43b06 100644
--- a/display/display.go
+++ b/display/display.go
@@ -19,7 +19,6 @@
 package display
 
 import (
-   "errors"
"fmt"
"github.com/apache/skywalking-cli/display/json"
"github.com/apache/skywalking-cli/display/table"
@@ -46,6 +45,6 @@ func Display(ctx *cli.Context, object interface{}) error {
case Table:
return table.Display(object)
default:
-   return errors.New(fmt.Sprintf("unsupported display style: %s", 
displayStyle))
+   return fmt.Errorf("unsupported display style: %s", displayStyle)
}
 }



[skywalking-cli] 04/29: Merge pull request #1 from apache/kezhenxu94-patch-1

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 4e660c9744fcb7d6fde60521d2eff629d20515be
Merge: a289a59 9cbbdff
Author: 吴晟 Wu Sheng 
AuthorDate: Wed Nov 6 21:49:33 2019 +0800

Merge pull request #1 from apache/kezhenxu94-patch-1

Add license file

 LICENSE | 201 
 NOTICE  |   5 ++
 2 files changed, 206 insertions(+)



[skywalking-cli] 25/29: Merge pull request #6 from kezhenxu94/feature/graphql-client

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 6562efe2fe837cd574e2ee622bbc4a04c5cd5301
Merge: 5d95a06 c8eb90b
Author: 吴晟 Wu Sheng 
AuthorDate: Sat Nov 9 22:12:49 2019 +0800

Merge pull request #6 from kezhenxu94/feature/graphql-client

[Feature] Set GraphQL client and add service ls command

 .asf.yaml  |  17 +
 .github/workflows/go.yml   |  48 +-
 Makefile   |   5 +-
 commands/interceptor/duration.go   | 130 
 commands/interceptor/duration_test.go  | 150 +
 .../interceptor/interceptor.go |  27 +-
 swctl/service/service.go => commands/model/step.go |  38 +-
 commands/service/list.go   |  75 +++
 {swctl => commands}/service/service.go |  24 +-
 swctl/service/list.go => config/config.go  |   8 +-
 go.mod |   4 +-
 go.sum |   5 +
 cmd/main.go => graphql/client/client.go|  47 +-
 graphql/schema/schema.go   | 750 +
 logger/log.go  |   4 +-
 scripts/build  |   2 +-
 swctl/main.go  |  86 +++
 cmd/main.go => util/io.go  |  40 +-
 18 files changed, 1339 insertions(+), 121 deletions(-)



[skywalking-cli] 11/29: Create .asf.yaml

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 8e8de7a15e3b681484a7311c8432552fe5338876
Author: kezhenxu94 
AuthorDate: Wed Nov 6 23:23:31 2019 +0800

Create .asf.yaml
---
 .asf.yaml | 9 +
 1 file changed, 9 insertions(+)

diff --git a/.asf.yaml b/.asf.yaml
new file mode 100644
index 000..3f2645a
--- /dev/null
+++ b/.asf.yaml
@@ -0,0 +1,9 @@
+github:
+  description: Apache SkyWalking CLI
+  homepage: https://skywalking.apache.org/
+  labels:
+- skywalking
+- observability
+- apm
+- distributed-tracing
+- cli



[skywalking-cli] 07/29: Update go.yml

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit c23eea01828c7594931af87c5db3f563347ed7b9
Author: kezhenxu94 
AuthorDate: Wed Nov 6 21:55:37 2019 +0800

Update go.yml
---
 .github/workflows/go.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index a3a570e..bdc008c 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -41,4 +41,4 @@ jobs:
 fi
 
 - name: Build
-  run: go build -v .
+  run: make



[skywalking-cli] 06/29: Update go.yml

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 69cf83391952067f57e954c808d38c4a05a246fe
Author: kezhenxu94 
AuthorDate: Wed Nov 6 21:52:04 2019 +0800

Update go.yml
---
 .github/workflows/go.yml | 16 
 1 file changed, 16 insertions(+)

diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 62aa1dd..a3a570e 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -1,3 +1,19 @@
+# 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.
+
 name: Go
 on: [push, pull_request]
 jobs:



[skywalking-cli] 20/29: Redesign start end time when absent and present

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit b31dc3d60fcdd49394bb278d11a6582579ce
Author: kezhenxu94 
AuthorDate: Sat Nov 9 20:02:42 2019 +0800

Redesign start end time when absent and present
---
 commands/interceptor/duration.go  | 97 +--
 commands/interceptor/duration_test.go | 64 ---
 2 files changed, 116 insertions(+), 45 deletions(-)

diff --git a/commands/interceptor/duration.go b/commands/interceptor/duration.go
index 55c4b86..1be9974 100644
--- a/commands/interceptor/duration.go
+++ b/commands/interceptor/duration.go
@@ -26,32 +26,31 @@ import (
 )
 
 var stepFormats = map[schema.Step]string{
-   schema.StepSecond: "2006-01-02 1504",
+   schema.StepSecond: "2006-01-02 150400",
schema.StepMinute: "2006-01-02 1504",
schema.StepHour:   "2006-01-02 15",
schema.StepDay:"2006-01-02",
-   schema.StepMonth:  "2006-01-02",
+   schema.StepMonth:  "2006-01",
 }
 
-var supportedTimeLayouts = []string{
-   "2006-01-02 150400",
-   "2006-01-02 1504",
-   "2006-01-02 15",
-   "2006-01-02",
-   "2006-01",
+var stepDuration = map[schema.Step]time.Duration{
+   schema.StepSecond: time.Second,
+   schema.StepMinute: time.Minute,
+   schema.StepHour:   time.Hour,
+   schema.StepDay:time.Hour * 24,
+   schema.StepMonth:  time.Hour * 24 * 30,
 }
 
-func tryParseTime(unparsed string, parsed *time.Time) error {
+func tryParseTime(unparsed string) (schema.Step, time.Time, error) {
var possibleError error = nil
-   for _, layout := range supportedTimeLayouts {
+   for step, layout := range stepFormats {
t, err := time.Parse(layout, unparsed)
if err == nil {
-   *parsed = t
-   return nil
+   return step, t, nil
}
possibleError = err
}
-   return possibleError
+   return schema.StepSecond, time.Time{}, possibleError
 }
 
 // DurationInterceptor sets the duration if absent, and formats it accordingly,
@@ -80,42 +79,62 @@ func DurationInterceptor(ctx *cli.Context) error {
 // in the format, (e.g. 2019-11-09 1001), so they'll be considered as 
UTC-based,
 // and generate the missing `start`(`end`) based on the same timezone, UTC
 func ParseDuration(start string, end string) (time.Time, time.Time, 
schema.Step) {
+   logger.Log.Debugln("Start time:", start, "end time:", end)
+
now := time.Now().UTC()
 
-   startTime := now
-   endTime := now
-   logger.Log.Debugln("Start time:", start, "end time:", end)
-   if len(start) == 0 && len(end) == 0 { // both absent
-   startTime = now.Add(-30 * time.Minute)
-   endTime = now
-   } else if len(end) == 0 { // start is present
-   if err := tryParseTime(start, ); err != nil {
+   // both are absent
+   if len(start) == 0 && len(end) == 0 {
+   return now.Add(-30 * time.Minute), now, schema.StepMinute
+   }
+
+   var startTime, endTime time.Time
+   var step schema.Step
+   var err error
+
+   // both are present
+   if len(start) > 0 && len(end) > 0 {
+   start, end = AlignPrecision(start, end)
+
+   if step, startTime, err = tryParseTime(start); err != nil {
logger.Log.Fatalln("Unsupported time format:", start, 
err)
}
-   } else if len(start) == 0 { // end is present
-   if err := tryParseTime(end, ); err != nil {
+   if step, endTime, err = tryParseTime(end); err != nil {
logger.Log.Fatalln("Unsupported time format:", end, err)
}
-   } else { // both are present
-   if err := tryParseTime(start, ); err != nil {
+
+   return startTime, endTime, step
+   }
+
+   // end is absent
+   if len(end) == 0 {
+   if step, startTime, err = tryParseTime(start); err != nil {
logger.Log.Fatalln("Unsupported time format:", start, 
err)
}
-   if err := tryParseTime(end, ); err != nil {
+   return startTime, startTime.Add(30 * stepDuration[step]), step
+   }
+
+   // start is present
+   if len(start) == 0 {
+   if step, endTime, err = tryParseTime(end); err != nil {
logger.Log.Fatalln("Unsupported time format:", end, err)
}
+   return endTime.Add(-30 * stepDuration[step]), endTime, step
}
-   duration := endTime.Sub(startTime)
-   step := schema.StepSecond
-   if duration.Hours() >= 24*30 { // time range > 1 month
-   step = schema.StepMonth
-   } else if duration.Hours() > 24 { // time range > 

[skywalking-cli] 05/29: Set up GitHub Action for PR and push

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit a2ca521cf7eb6844a5e8ed9e9fb21f89a518246b
Author: kezhenxu94 
AuthorDate: Wed Nov 6 21:51:14 2019 +0800

Set up GitHub Action for PR and push
---
 .github/workflows/go.yml | 28 
 1 file changed, 28 insertions(+)

diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
new file mode 100644
index 000..62aa1dd
--- /dev/null
+++ b/.github/workflows/go.yml
@@ -0,0 +1,28 @@
+name: Go
+on: [push, pull_request]
+jobs:
+
+  build:
+name: Build
+runs-on: ubuntu-latest
+steps:
+
+- name: Set up Go 1.13
+  uses: actions/setup-go@v1
+  with:
+go-version: 1.13
+  id: go
+
+- name: Check out code into the Go module directory
+  uses: actions/checkout@v1
+
+- name: Get dependencies
+  run: |
+go get -v -t -d ./...
+if [ -f Gopkg.toml ]; then
+curl 
https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
+dep ensure
+fi
+
+- name: Build
+  run: go build -v .



[skywalking-cli] 12/29: Merge pull request #5 from apache/kezhenxu94-patch-1

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit f60a82629bf00a46b527b794384f0f95d97dbb9b
Merge: d7789a9 8e8de7a
Author: 吴晟 Wu Sheng 
AuthorDate: Wed Nov 6 23:43:01 2019 +0800

Merge pull request #5 from apache/kezhenxu94-patch-1

Create .asf.yaml

 .asf.yaml | 9 +
 1 file changed, 9 insertions(+)



[skywalking-cli] 27/29: Abstract display layer and support json/yaml/table display styles

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 79165a6ddbc7c3a07c24c6bd57773e851b90274d
Author: kezhenxu94 
AuthorDate: Sun Nov 10 03:15:26 2019 +0800

Abstract display layer and support json/yaml/table display styles
---
 commands/service/list.go   | 13 ++--
 config/config.go => display/display.go | 34 ---
 config/config.go => display/json/json.go   | 17 +++---
 config/config.go => display/table/table.go | 38 ++---
 config/config.go => display/yaml/yaml.go   | 17 +++---
 go.mod |  1 +
 go.sum |  6 
 graphql/client/client.go   |  9 ++---
 swctl/main.go  | 53 --
 9 files changed, 140 insertions(+), 48 deletions(-)

diff --git a/commands/service/list.go b/commands/service/list.go
index d57f970..60d2912 100644
--- a/commands/service/list.go
+++ b/commands/service/list.go
@@ -19,11 +19,10 @@
 package service
 
 import (
-   "encoding/json"
-   "fmt"
"github.com/apache/skywalking-cli/commands/flags"
"github.com/apache/skywalking-cli/commands/interceptor"
"github.com/apache/skywalking-cli/commands/model"
+   "github.com/apache/skywalking-cli/display"
"github.com/apache/skywalking-cli/graphql/client"
"github.com/apache/skywalking-cli/graphql/schema"
"github.com/urfave/cli"
@@ -41,18 +40,12 @@ var ListCommand = cli.Command{
end := ctx.String("end")
start := ctx.String("start")
step := ctx.Generic("step")
-   services := client.Services(schema.Duration{
+   services := client.Services(ctx, schema.Duration{
Start: start,
End:   end,
Step:  step.(*model.StepEnumValue).Selected,
})
 
-   if bytes, e := json.Marshal(services); e == nil {
-   fmt.Printf("%v\n", string(bytes))
-   } else {
-   return e
-   }
-
-   return nil
+   return display.Display(ctx, services)
},
 }
diff --git a/config/config.go b/display/display.go
similarity index 52%
copy from config/config.go
copy to display/display.go
index 0565fee..3d54f6b 100644
--- a/config/config.go
+++ b/display/display.go
@@ -16,10 +16,36 @@
  *
  */
 
-package config
+package display
 
-var Config struct {
-   Global struct {
-   BaseURL string `yaml:"base-url"`
+import (
+   "errors"
+   "fmt"
+   "github.com/apache/skywalking-cli/display/json"
+   "github.com/apache/skywalking-cli/display/table"
+   "github.com/apache/skywalking-cli/display/yaml"
+   "github.com/urfave/cli"
+   "strings"
+)
+
+const (
+   Json  string = "json"
+   Yaml  string = "yaml"
+   Table string = "table"
+)
+
+// Display the object in the style specified in flag --display
+func Display(ctx *cli.Context, object interface{}) error {
+   displayStyle := ctx.GlobalString("display")
+
+   switch strings.ToLower(displayStyle) {
+   case Json:
+   return json.Display(object)
+   case Yaml:
+   return yaml.Display(object)
+   case Table:
+   return table.Display(object)
+   default:
+   return errors.New(fmt.Sprintf("unsupported display style: %s", 
displayStyle))
}
 }
diff --git a/config/config.go b/display/json/json.go
similarity index 79%
copy from config/config.go
copy to display/json/json.go
index 0565fee..9cda203 100644
--- a/config/config.go
+++ b/display/json/json.go
@@ -16,10 +16,19 @@
  *
  */
 
-package config
+package json
 
-var Config struct {
-   Global struct {
-   BaseURL string `yaml:"base-url"`
+import (
+   "encoding/json"
+   "fmt"
+)
+
+func Display(object interface{}) error {
+   if bytes, e := json.Marshal(object); e == nil {
+   fmt.Printf("%v\n", string(bytes))
+   } else {
+   return e
}
+
+   return nil
 }
diff --git a/config/config.go b/display/table/table.go
similarity index 56%
copy from config/config.go
copy to display/table/table.go
index 0565fee..b460f9d 100644
--- a/config/config.go
+++ b/display/table/table.go
@@ -16,10 +16,40 @@
  *
  */
 
-package config
+package table
 
-var Config struct {
-   Global struct {
-   BaseURL string `yaml:"base-url"`
+import (
+   "encoding/json"
+   "github.com/olekukonko/tablewriter"
+   "os"
+)
+
+func Display(object interface{}) error {
+   var objMaps []map[string]string
+
+   bytes, _ := json.Marshal(object)
+   _ = json.Unmarshal(bytes, )
+
+   var header []string
+
+   for k := range objMaps[0] {
+  

[skywalking-cli] 26/29: Extract commonly-used flags for reuse

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 1ccb9b91fbb912c9d873dbafb70b99558e6d92cc
Author: kezhenxu94 
AuthorDate: Sun Nov 10 01:09:27 2019 +0800

Extract commonly-used flags for reuse
---
 commands/flags/duration.go | 48 ++
 commands/service/list.go   | 21 ++--
 2 files changed, 50 insertions(+), 19 deletions(-)

diff --git a/commands/flags/duration.go b/commands/flags/duration.go
new file mode 100644
index 000..d4b3f83
--- /dev/null
+++ b/commands/flags/duration.go
@@ -0,0 +1,48 @@
+/*
+ * 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 flags
+
+import (
+   "github.com/apache/skywalking-cli/commands/model"
+   "github.com/apache/skywalking-cli/graphql/schema"
+   "github.com/urfave/cli"
+)
+
+// DurationFlags are common flags that involves a duration, composed
+// by a start time, an end time, and a step, which is commonly used
+// in most of the commands
+var DurationFlags = []cli.Flag{
+   cli.StringFlag{
+   Name:  "start",
+   Usage: "query start `TIME`",
+   },
+   cli.StringFlag{
+   Name:  "end",
+   Usage: "query end `TIME`",
+   },
+   cli.GenericFlag{
+   Name:   "step",
+   Hidden: true,
+   Value: {
+   Enum: schema.AllStep,
+   Default:  schema.StepMinute,
+   Selected: schema.StepMinute,
+   },
+   },
+}
diff --git a/commands/service/list.go b/commands/service/list.go
index 257bc3a..d57f970 100644
--- a/commands/service/list.go
+++ b/commands/service/list.go
@@ -21,6 +21,7 @@ package service
 import (
"encoding/json"
"fmt"
+   "github.com/apache/skywalking-cli/commands/flags"
"github.com/apache/skywalking-cli/commands/interceptor"
"github.com/apache/skywalking-cli/commands/model"
"github.com/apache/skywalking-cli/graphql/client"
@@ -32,25 +33,7 @@ var ListCommand = cli.Command{
Name:  "list",
ShortName: "ls",
Usage: "List all available services",
-   Flags: []cli.Flag{
-   cli.StringFlag{
-   Name:  "start",
-   Usage: "query start `TIME`",
-   },
-   cli.StringFlag{
-   Name:  "end",
-   Usage: "query end `TIME`",
-   },
-   cli.GenericFlag{
-   Name:   "step",
-   Hidden: true,
-   Value: {
-   Enum: schema.AllStep,
-   Default:  schema.StepMinute,
-   Selected: schema.StepMinute,
-   },
-   },
-   },
+   Flags: flags.DurationFlags,
Before: interceptor.BeforeChain([]cli.BeforeFunc{
interceptor.DurationInterceptor,
}),



[skywalking-cli] 09/29: Update README.md (#3)

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit d7789a9eb1c6e557764aa162769036a8fd856f1e
Author: 吴晟 Wu Sheng 
AuthorDate: Wed Nov 6 22:18:26 2019 +0800

Update README.md (#3)
---
 README.md | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index eaf2c6a..2e110f2 100644
--- a/README.md
+++ b/README.md
@@ -3,4 +3,16 @@ Apache SkyWalking CLI
 
 http://skywalking.apache.org/assets/logo.svg; alt="Sky Walking logo" 
height="90px" align="right" />
 
-The CLI for [Apache SkyWalking](https://github.com/apache/skywalking).
\ No newline at end of file
+The CLI (Command Line Interface) for [Apache 
SkyWalking](https://github.com/apache/skywalking).
+
+SkyWalking CLI is a command interaction tool for the SkyWalking user or OPS 
team, as an alternative besides using browser GUI.
+It is based on SkyWalking [GraphQL query 
protocol](https://github.com/apache/skywalking-query-protocol), same as GUI.
+
+# Commands
+TODO
+
+# Compiling project
+TODO
+
+# License
+[Apache 2.0 License.](/LICENSE)



[GitHub] [skywalking-cli] wu-sheng commented on a change in pull request #8: Add command manual and documentations

2019-11-09 Thread GitBox
wu-sheng commented on a change in pull request #8: Add command manual and 
documentations
URL: https://github.com/apache/skywalking-cli/pull/8#discussion_r344466547
 
 

 ##
 File path: README.md
 ##
 @@ -1,18 +1,63 @@
 Apache SkyWalking CLI
 ===
 
+![](https://github.com/apache/skywalking-cli/workflows/Build/badge.svg?branch=master)
+![](https://codecov.io/gh/apache/skywalking-cli/branch/master/graph/badge.svg)
+
 http://skywalking.apache.org/assets/logo.svg; alt="Sky Walking logo" 
height="90px" align="right" />
 
 The CLI (Command Line Interface) for [Apache 
SkyWalking](https://github.com/apache/skywalking).
 
 SkyWalking CLI is a command interaction tool for the SkyWalking user or OPS 
team, as an alternative besides using browser GUI.
 It is based on SkyWalking [GraphQL query 
protocol](https://github.com/apache/skywalking-query-protocol), same as GUI.
 
+# Install
+As SkyWalking CLI is using `Makefile`, compiling the project is as easy as 
executing a command in the root directory of the project.
+
+```shell
+git clone https://github.com/apache/skywalking-cli
+cd skywalking-cli
+make clean && make
+```
+
+and copy the `./bin/swctl` to your `PATH` directory, usually `/usr/bin/` or 
`/usr/local/bin`, or you can copy it to any directory you like,
+and add that directory to `PATH`.
+
 # Commands
-TODO
+Commands in SkyWalking CLI are organized into two levels, in the form of 
`swctl --option  --option  --option`,
+there're options in each level, which should follow right after the 
corresponding command, take the following command as example:
+
+```shell
+$ swctl --debug service list --start="2019-11-11" --end="2019-11-12"
+```
+
+where `--debug` is is an option of `swctl`, and since the `swctl` is a 
top-level command, `--debug` is also called global option,
+and `--start` is an option of the third level command `list`, there is no 
option for the second level command `service`.
+
+Generally, the second level commands are entity related, there're entities 
like `service`, `service instance`, `metrics` in SkyWalking,
+and we have corresponding sub-command like `service`; the third level commands 
are operations on the entities, such as `list` command
+will list all the `service`s, `service instance`s, etc.
+
+## All available commands
+This section covers all the available commands in SkyWalking CLI and their 
usages
+
+### `service` sub-command
+`service` sub-command (second level command) is an entry for all operations 
related to services, and it also has some sub-commands.
+
+ `service list [--start=] [--end=]`
+`service list` lists all the services in the time range of \[`start`, `end`\].
+`--start` and `--end` are both optional, and their default values follow the 
rules below:
 
 Review comment:
   Time should be a shared config in all entity related query. 


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] wu-sheng commented on a change in pull request #8: Add command manual and documentations

2019-11-09 Thread GitBox
wu-sheng commented on a change in pull request #8: Add command manual and 
documentations
URL: https://github.com/apache/skywalking-cli/pull/8#discussion_r344466515
 
 

 ##
 File path: README.md
 ##
 @@ -1,18 +1,63 @@
 Apache SkyWalking CLI
 ===
 
+![](https://github.com/apache/skywalking-cli/workflows/Build/badge.svg?branch=master)
+![](https://codecov.io/gh/apache/skywalking-cli/branch/master/graph/badge.svg)
+
 http://skywalking.apache.org/assets/logo.svg; alt="Sky Walking logo" 
height="90px" align="right" />
 
 The CLI (Command Line Interface) for [Apache 
SkyWalking](https://github.com/apache/skywalking).
 
 SkyWalking CLI is a command interaction tool for the SkyWalking user or OPS 
team, as an alternative besides using browser GUI.
 It is based on SkyWalking [GraphQL query 
protocol](https://github.com/apache/skywalking-query-protocol), same as GUI.
 
+# Install
+As SkyWalking CLI is using `Makefile`, compiling the project is as easy as 
executing a command in the root directory of the project.
+
+```shell
+git clone https://github.com/apache/skywalking-cli
+cd skywalking-cli
+make clean && make
+```
+
+and copy the `./bin/swctl` to your `PATH` directory, usually `/usr/bin/` or 
`/usr/local/bin`, or you can copy it to any directory you like,
+and add that directory to `PATH`.
+
 # Commands
-TODO
+Commands in SkyWalking CLI are organized into two levels, in the form of 
`swctl --option  --option  --option`,
 
 Review comment:
   This looks like a design, rather than doc. I think you should re-organize 
words. Begin with the command tree or table, move the design to another design 
or contributor doc. Most users don't need to understand this.


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] wu-sheng commented on a change in pull request #8: Add command manual and documentations

2019-11-09 Thread GitBox
wu-sheng commented on a change in pull request #8: Add command manual and 
documentations
URL: https://github.com/apache/skywalking-cli/pull/8#discussion_r344466446
 
 

 ##
 File path: README.md
 ##
 @@ -1,18 +1,63 @@
 Apache SkyWalking CLI
 ===
 
+![](https://github.com/apache/skywalking-cli/workflows/Build/badge.svg?branch=master)
+![](https://codecov.io/gh/apache/skywalking-cli/branch/master/graph/badge.svg)
+
 http://skywalking.apache.org/assets/logo.svg; alt="Sky Walking logo" 
height="90px" align="right" />
 
 The CLI (Command Line Interface) for [Apache 
SkyWalking](https://github.com/apache/skywalking).
 
 SkyWalking CLI is a command interaction tool for the SkyWalking user or OPS 
team, as an alternative besides using browser GUI.
 It is based on SkyWalking [GraphQL query 
protocol](https://github.com/apache/skywalking-query-protocol), same as GUI.
 
+# Install
+As SkyWalking CLI is using `Makefile`, compiling the project is as easy as 
executing a command in the root directory of the project.
+
+```shell
+git clone https://github.com/apache/skywalking-cli
+cd skywalking-cli
+make clean && make
+```
+
+and copy the `./bin/swctl` to your `PATH` directory, usually `/usr/bin/` or 
`/usr/local/bin`, or you can copy it to any directory you like,
+and add that directory to `PATH`.
+
 # Commands
-TODO
+Commands in SkyWalking CLI are organized into two levels, in the form of 
`swctl --option  --option  --option`,
+there're options in each level, which should follow right after the 
corresponding command, take the following command as example:
+
+```shell
+$ swctl --debug service list --start="2019-11-11" --end="2019-11-12"
+```
+
+where `--debug` is is an option of `swctl`, and since the `swctl` is a 
top-level command, `--debug` is also called global option,
+and `--start` is an option of the third level command `list`, there is no 
option for the second level command `service`.
 
 Review comment:
   The description is not consistent, should we call second or third level 
command? 


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] codecov-io commented on issue #9: [Feature] Support multiple display styles, JSON, YAML, ASCII Table

2019-11-09 Thread GitBox
codecov-io commented on issue #9: [Feature] Support multiple display styles, 
JSON, YAML, ASCII Table
URL: https://github.com/apache/skywalking-cli/pull/9#issuecomment-552129760
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/9?src=pr=h1) 
Report
   > Merging 
[#9](https://codecov.io/gh/apache/skywalking-cli/pull/9?src=pr=desc) into 
[master](https://codecov.io/gh/apache/skywalking-cli/commit/6562efe2fe837cd574e2ee622bbc4a04c5cd5301?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking-cli/pull/9/graphs/tree.svg?width=650=oivudZDTNJ=150=pr)](https://codecov.io/gh/apache/skywalking-cli/pull/9?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master   #9   +/-   ##
   ===
 Coverage   51.85%   51.85%   
   ===
 Files   22   
 Lines  54   54   
   ===
 Hits   28   28   
 Misses 22   22   
 Partials44
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/9?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/9?src=pr=footer). 
Last update 
[6562efe...f3ce003](https://codecov.io/gh/apache/skywalking-cli/pull/9?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] kezhenxu94 opened a new pull request #9: [Feature] Support multiple display styles, JSON, YAML, ASCII Table

2019-11-09 Thread GitBox
kezhenxu94 opened a new pull request #9: [Feature] Support multiple display 
styles, JSON, YAML, ASCII Table
URL: https://github.com/apache/skywalking-cli/pull/9
 
 
   Seems that people like table style, 
https://github.com/apache/skywalking-cli/pull/6#discussion_r343972888 , 
https://github.com/apache/skywalking-cli/pull/6#issuecomment-551076830 , this 
patch abstract a display layer and provides several display style 
implementations, JSON, YAML and ASCII table, works like this:
   
   ```shell
   skywalking-cli (feature/display-styles $) -> ./bin/swctl --display=table 
--debug=false service ls 
   ++--+
   | ID |   NAME   |
   ++--+
   |  4 | projectA |
   |  2 | projectB |
   |  5 | projectD |
   |  3 | projectC |
   ++--+
   
   skywalking-cli (feature/display-styles $) -> ./bin/swctl --display=json 
--debug=false service ls 
   
[{"id":"4","name":"projectA"},{"id":"2","name":"projectB"},{"id":"5","name":"projectD"},{"id":"3","name":"projectC"}]
   
   skywalking-cli (feature/display-styles $) -> ./bin/swctl --display=yaml 
--debug=false service ls 
   - id: "4"
 name: projectA
   - id: "2"
 name: projectB
   - id: "5"
 name: projectD
   - id: "3"
 name: projectC
   
   skywalking-cli (feature/display-styles $) -> 
   ```
   
   will supplement the related documentations after #8 is merged


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] codecov-io commented on issue #8: Doc/manual badge

2019-11-09 Thread GitBox
codecov-io commented on issue #8: Doc/manual badge
URL: https://github.com/apache/skywalking-cli/pull/8#issuecomment-552117647
 
 
   # [Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=h1) 
Report
   > Merging 
[#8](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=desc) into 
[master](https://codecov.io/gh/apache/skywalking-cli/commit/6562efe2fe837cd574e2ee622bbc4a04c5cd5301?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/skywalking-cli/pull/8/graphs/tree.svg?width=650=oivudZDTNJ=150=pr)](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master   #8   +/-   ##
   ===
 Coverage   51.85%   51.85%   
   ===
 Files   22   
 Lines  54   54   
   ===
 Hits   28   28   
 Misses 22   22   
 Partials44
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=footer). 
Last update 
[6562efe...0a6f5be](https://codecov.io/gh/apache/skywalking-cli/pull/8?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


With regards,
Apache Git Services


[GitHub] [skywalking-cli] kezhenxu94 opened a new pull request #8: Doc/manual badge

2019-11-09 Thread GitBox
kezhenxu94 opened a new pull request #8: Doc/manual badge
URL: https://github.com/apache/skywalking-cli/pull/8
 
 
   The GitHub Action name was `Go`, and the badge is 
![](https://github.com/apache/skywalking-cli/workflows/Go/badge.svg?branch=master),
 which is somewhat odd, so I change it to `Build`, and the code coverage is 
![](https://codecov.io/gh/apache/skywalking-cli/branch/master/graph/badge.svg)


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #3583: Plugin test-cases immigrate plan

2019-11-09 Thread GitBox
wu-sheng commented on issue #3583: Plugin test-cases immigrate plan
URL: https://github.com/apache/skywalking/issues/3583#issuecomment-552116765
 
 
   @arugal You should update the progress, and add the comment like dubbox 
plugon test.


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on issue #3583: Plugin test-cases immigrate plan

2019-11-09 Thread GitBox
wu-sheng commented on issue #3583: Plugin test-cases immigrate plan
URL: https://github.com/apache/skywalking/issues/3583#issuecomment-552116767
 
 
   @arugal You should update the progress, and add the comment like dubbox 
plugon test.


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


With regards,
Apache Git Services


[GitHub] [skywalking] aderm commented on issue #3815: [agent/plugin] Fix config variable usage bug

2019-11-09 Thread GitBox
aderm commented on issue #3815: [agent/plugin] Fix config variable usage bug
URL: https://github.com/apache/skywalking/pull/3815#issuecomment-552114803
 
 
   ACK


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal commented on issue #3583: Plugin test-cases immigrate plan

2019-11-09 Thread GitBox
arugal commented on issue #3583: Plugin test-cases immigrate plan
URL: https://github.com/apache/skywalking/issues/3583#issuecomment-552112298
 
 
   > jdk-cross-thread-scenario for me
   
   [apm-toolkit 
-trace-scenario](https://github.com/apache/skywalking/tree/master/test/plugin/scenarios/apm-toolkit-trace-scenario)
 has covered ```TraceCrossThread```, so we can give up immigreate 
[jdk-cross-thread-scenario](https://github.com/SkyAPMTest/agent-auto-integration-testcases/tree/master/jdk-cross-thread-scenario).


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


With regards,
Apache Git Services


[GitHub] [skywalking] aderm commented on a change in pull request #3803: Add elasticsearch 6.x plugin & elasticsearch 6.x test scenario

2019-11-09 Thread GitBox
aderm commented on a change in pull request #3803: Add elasticsearch 6.x plugin 
& elasticsearch 6.x test scenario
URL: https://github.com/apache/skywalking/pull/3803#discussion_r38751
 
 

 ##
 File path: 
apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/RemotePeerCache.java
 ##
 @@ -0,0 +1,46 @@
+/*
+ * 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.apm.plugin.elasticsearch.v6;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author aderm
+ */
+public class RemotePeerCache {
+
+private List remotePeerList = Collections.synchronizedList(new 
ArrayList());
 
 Review comment:
   Ack


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


With regards,
Apache Git Services


[GitHub] [skywalking] aderm commented on a change in pull request #3803: Add elasticsearch 6.x plugin & elasticsearch 6.x test scenario

2019-11-09 Thread GitBox
aderm commented on a change in pull request #3803: Add elasticsearch 6.x plugin 
& elasticsearch 6.x test scenario
URL: https://github.com/apache/skywalking/pull/3803#discussion_r38656
 
 

 ##
 File path: test/plugin/scenarios/elasticsearch-6.x-scenario/bin/startup.sh
 ##
 @@ -0,0 +1,23 @@
+#!/bin/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.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} -Dskywalking.plugin.elasticsearch.trace_dsl=true 
${home}/../libs/elasticsearch-6.x-scenario.jar &
+
+# user for more time to collect data
+sleep 5
 
 Review comment:
   ok


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


With regards,
Apache Git Services


[GitHub] [skywalking] viswaramamoorthy commented on issue #3788: Rabbitmq plugin test migration

2019-11-09 Thread GitBox
viswaramamoorthy commented on issue #3788: Rabbitmq plugin test migration
URL: https://github.com/apache/skywalking/pull/3788#issuecomment-552108060
 
 
   @arugal @wu-sheng I have pushed commit with code review comment changes. 


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


With regards,
Apache Git Services


[GitHub] [skywalking] wu-sheng commented on a change in pull request #3803: Add elasticsearch 6.x plugin & elasticsearch 6.x test scenario

2019-11-09 Thread GitBox
wu-sheng commented on a change in pull request #3803: Add elasticsearch 6.x 
plugin & elasticsearch 6.x test scenario
URL: https://github.com/apache/skywalking/pull/3803#discussion_r37500
 
 

 ##
 File path: test/plugin/scenarios/elasticsearch-6.x-scenario/bin/startup.sh
 ##
 @@ -0,0 +1,23 @@
+#!/bin/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.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} -Dskywalking.plugin.elasticsearch.trace_dsl=true 
${home}/../libs/elasticsearch-6.x-scenario.jar &
+
+# user for more time to collect data
+sleep 5
 
 Review comment:
   @aderm Anything you need to do or wait, put those in your codes and add 
check logic. Don't use time to verify, it is unstable, we were facing this kind 
of issue multiple times. 


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


With regards,
Apache Git Services


[skywalking] branch master updated: fix config variable usage bug (#3815)

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
 new 555de82  fix config variable usage bug (#3815)
555de82 is described below

commit 555de82500563a063c5e2853a6f06b9e7a00b92a
Author: zhang-wei 
AuthorDate: Sat Nov 9 22:58:46 2019 +0800

fix config variable usage bug (#3815)
---
 .../jdbc/postgresql/PreparedStatementExecuteMethodsInterceptor.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/PreparedStatementExecuteMethodsInterceptor.java
 
b/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/PreparedStatementExecuteMethodsInterceptor.java
index 6686e6b..b723782 100755
--- 
a/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/PreparedStatementExecuteMethodsInterceptor.java
+++ 
b/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/PreparedStatementExecuteMethodsInterceptor.java
@@ -58,7 +58,7 @@ public class PreparedStatementExecuteMethodsInterceptor 
implements InstanceMetho
 if (parameters != null && parameters.length > 0) {
 int maxIndex = cacheObject.getMaxIndex();
 String parameterString = buildParameterString(parameters, 
maxIndex);
-int sqlParametersMaxLength = 
Config.Plugin.MySQL.SQL_PARAMETERS_MAX_LENGTH;
+int sqlParametersMaxLength = 
Config.Plugin.POSTGRESQL.SQL_PARAMETERS_MAX_LENGTH;
 if (sqlParametersMaxLength > 0 && parameterString.length() > 
sqlParametersMaxLength) {
 parameterString = parameterString.substring(0, 
sqlParametersMaxLength) + "..." + "]";
 }



[GitHub] [skywalking] wu-sheng merged pull request #3815: [agent/plugin] Fix config variable usage bug

2019-11-09 Thread GitBox
wu-sheng merged pull request #3815: [agent/plugin] Fix config variable usage bug
URL: https://github.com/apache/skywalking/pull/3815
 
 
   


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


With regards,
Apache Git Services


[GitHub] [skywalking] aderm commented on a change in pull request #3803: Add elasticsearch 6.x plugin & elasticsearch 6.x test scenario

2019-11-09 Thread GitBox
aderm commented on a change in pull request #3803: Add elasticsearch 6.x plugin 
& elasticsearch 6.x test scenario
URL: https://github.com/apache/skywalking/pull/3803#discussion_r37120
 
 

 ##
 File path: test/plugin/scenarios/elasticsearch-6.x-scenario/bin/startup.sh
 ##
 @@ -0,0 +1,23 @@
+#!/bin/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.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} -Dskywalking.plugin.elasticsearch.trace_dsl=true 
${home}/../libs/elasticsearch-6.x-scenario.jar &
+
+# user for more time to collect data
+sleep 5
 
 Review comment:
   Ok, now i will remove `sleep 5`


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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 commented on issue #3819: [CLI] Add more commands to SkyWalking CLI

2019-11-09 Thread GitBox
kezhenxu94 commented on issue #3819: [CLI] Add more commands to SkyWalking CLI
URL: https://github.com/apache/skywalking/issues/3819#issuecomment-552106911
 
 
   > I'll try Instance --list
   
   Create another issue to track this command, and cross refer to this issue 


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


With regards,
Apache Git Services


[GitHub] [skywalking] aderm commented on a change in pull request #3803: Add elasticsearch 6.x plugin & elasticsearch 6.x test scenario

2019-11-09 Thread GitBox
aderm commented on a change in pull request #3803: Add elasticsearch 6.x plugin 
& elasticsearch 6.x test scenario
URL: https://github.com/apache/skywalking/pull/3803#discussion_r37060
 
 

 ##
 File path: test/plugin/scenarios/elasticsearch-6.x-scenario/bin/startup.sh
 ##
 @@ -0,0 +1,23 @@
+#!/bin/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.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} -Dskywalking.plugin.elasticsearch.trace_dsl=true 
${home}/../libs/elasticsearch-6.x-scenario.jar &
+
+# user for more time to collect data
+sleep 5
 
 Review comment:
   Sorry, there is a problem with the above explanation. The healthCheck is 
there. In fact, the reason is not that the ES startup time takes a few seconds, 
but because six requests are executed at one time in the test service, six 
segments are generated, and now In the JVM container, the waiting time for 
collection is 5s. Due to insufficient waiting time, the local information will 
result in incomplete collection of information, and the subsequent segments are 
not collected. I can normally collect it by adding a sleep to the wait above. 
And this local test success.  I just tested it, I removed `sleep 5`, and the 
test passed.


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


With regards,
Apache Git Services


[GitHub] [skywalking] arugal commented on issue #3819: [CLI] Add more commands to SkyWalking CLI

2019-11-09 Thread GitBox
arugal commented on issue #3819: [CLI] Add more commands to SkyWalking CLI
URL: https://github.com/apache/skywalking/issues/3819#issuecomment-552106139
 
 
   I'll try Instance --list


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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 opened a new issue #3819: [CLI] Add more commands to SkyWalking CLI

2019-11-09 Thread GitBox
kezhenxu94 opened a new issue #3819: [CLI] Add more commands to SkyWalking CLI
URL: https://github.com/apache/skywalking/issues/3819
 
 
   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [ ] Bug
   - [x] Requirement
   - [ ] Feature or performance improvement
   
   we have the first workable command now, 
http://github.com/apache/skywalking-cli/pull/6, and we'd like to welcome more 
contributors to add more commands, if you're interested in contributing one, 
please create an issue titled `[CLI] Add command  to SkyWalking 
CLI`, like `[CLI] Add command instance list to SkyWalking CLI`, and cross refer 
this issue, we'll assign it then


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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 opened a new issue #3818: [CLI] License checker for SkyWalking CLI

2019-11-09 Thread GitBox
kezhenxu94 opened a new issue #3818: [CLI] License checker for SkyWalking CLI
URL: https://github.com/apache/skywalking/issues/3818
 
 
   We don't have license checker for the 
[SkyWalking-CLI](https://github.com/apache/skywalking-cli) project now, and as 
an Apache TLP, this is a serious problem, so anyone have experience in this 
please help to add a checker for this project


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


With regards,
Apache Git Services


[GitHub] [skywalking] kezhenxu94 opened a new issue #3817: Tackling timezone in SkyWalking CLI

2019-11-09 Thread GitBox
kezhenxu94 opened a new issue #3817: Tackling timezone in SkyWalking CLI
URL: https://github.com/apache/skywalking/issues/3817
 
 
   As discussed in https://github.com/apache/skywalking-cli/pull/6 , we 
currently don't play well with the timezone in CLI, because the timezone API in 
backend is new in 6.4.0, and is not compatible with older versions, so we may 
make some tolerations or come out other sulotions to determine the timezone in 
CLI


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


With regards,
Apache Git Services


[GitHub] [skywalking] aderm commented on a change in pull request #3803: Add elasticsearch 6.x plugin & elasticsearch 6.x test scenario

2019-11-09 Thread GitBox
aderm commented on a change in pull request #3803: Add elasticsearch 6.x plugin 
& elasticsearch 6.x test scenario
URL: https://github.com/apache/skywalking/pull/3803#discussion_r35898
 
 

 ##
 File path: 
apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/IndicesClientCreateMethodsInterceptor.java
 ##
 @@ -0,0 +1,79 @@
+/*
+ * 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.apm.plugin.elasticsearch.v6.interceptor;
+
+import static 
org.apache.skywalking.apm.agent.core.conf.Config.Plugin.Elasticsearch.TRACE_DSL;
+
+import java.lang.reflect.Method;
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+import org.apache.skywalking.apm.agent.core.logging.api.ILog;
+import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
+import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
+import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+import org.apache.skywalking.apm.plugin.elasticsearch.v6.ESTypeEnum;
+import org.apache.skywalking.apm.plugin.elasticsearch.v6.RestClientEnhanceInfo;
+import org.elasticsearch.client.indices.CreateIndexRequest;
+
+/**
+ * @author aderm
+ */
+public class IndicesClientCreateMethodsInterceptor implements 
InstanceMethodsAroundInterceptor {
+
+private static final ILog logger = 
LogManager.getLogger(IndicesClientCreateMethodsInterceptor.class);
+
+@Override
+public void beforeMethod(EnhancedInstance objInst, Method method, Object[] 
allArguments,
+Class[] argumentsTypes, MethodInterceptResult result) throws 
Throwable {
+CreateIndexRequest createIndexRequest = 
(CreateIndexRequest)(allArguments[0]);
+
+RestClientEnhanceInfo restClientEnhanceInfo = (RestClientEnhanceInfo) 
(objInst
+.getSkyWalkingDynamicField());
+if (restClientEnhanceInfo != null) {
+AbstractSpan span = ContextManager
+.createExitSpan(Constants.CREATE_OPERATOR_NAME,
+restClientEnhanceInfo.getPeers());
+span.setComponent(ComponentsDefine.REST_HIGH_LEVEL_CLIENT);
+
+Tags.DB_TYPE.set(span, ESTypeEnum.CREATE.getType());
+Tags.DB_INSTANCE.set(span, createIndexRequest.index());
+if (TRACE_DSL) {
+Tags.DB_STATEMENT
+.set(span, createIndexRequest.mappings().utf8ToString());
+}
+SpanLayer.asDB(span);
+}
+}
+
+@Override
+public Object afterMethod(EnhancedInstance objInst, Method method, 
Object[] allArguments,
+Class[] argumentsTypes, Object ret) throws Throwable {
+ContextManager.stopSpan();
+return ret;
+}
 
 Review comment:
   ACK, in aftermethod, `if (restClientEnhanceInfo != null)`  will be added.


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


With regards,
Apache Git Services


[skywalking-cli] 19/25: Set up test coverage

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit d30b61df54c3229cbe3c385d946451deded0839e
Author: kezhenxu94 
AuthorDate: Sat Nov 9 12:55:16 2019 +0800

Set up test coverage
---
 .github/workflows/go.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index de9ad27..a8677f8 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -48,7 +48,7 @@ jobs:
   - name: Test
 run: |
   go test ./... -coverprofile=coverage.txt -covermode=atomic
-  bash <(curl -s https://codecov.io/bash)
+  CODECOV_TOKEN="a5af28a3-92a2-4b35-9a77-54ad99b1ae00" bash <(curl -s 
https://codecov.io/bash)
 
   - name: Build
 run: make clean && make



[skywalking-cli] 22/25: Polish comments of duration

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 32df1785d83c7e103dfb4a03ac820a816fd7e1e4
Author: kezhenxu94 
AuthorDate: Sat Nov 9 20:57:57 2019 +0800

Polish comments of duration
---
 commands/interceptor/duration.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/commands/interceptor/duration.go b/commands/interceptor/duration.go
index 88468ec..def8e20 100644
--- a/commands/interceptor/duration.go
+++ b/commands/interceptor/duration.go
@@ -73,8 +73,8 @@ func DurationInterceptor(ctx *cli.Context) error {
 
 // ParseDuration parses the `start` and `end` to a triplet, (startTime, 
endTime, step)
 // if --start and --end are both absent, then: start := now - 30min; end := now
-// if --start is given, --end is absent, then: end := now
-// if --start is absent, --end is given, then: start := end - 30min
+// if --start is given, --end is absent, then: end := now + 30 units, where 
unit is the precision of `start`, (hours, minutes, etc.)
+// if --start is absent, --end is given, then: start := end - 30 unis, where 
unit is the precision of `end`, (hours, minutes, etc.)
 // NOTE that when either(both) `start` or `end` is(are) given, there is no 
timezone info
 // in the format, (e.g. 2019-11-09 1001), so they'll be considered as 
UTC-based,
 // and generate the missing `start`(`end`) based on the same timezone, UTC



[skywalking-cli] 16/25: Remove stale files

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 5223581e0fdcc973b46efa18f6628f9c72024ee6
Author: kezhenxu94 
AuthorDate: Thu Nov 7 19:11:15 2019 +0800

Remove stale files
---
 cmd/main.go  | 50 
 cmd/service.go   | 42 
 swctl/service/list.go| 23 --
 swctl/service/service.go | 42 
 4 files changed, 157 deletions(-)

diff --git a/cmd/main.go b/cmd/main.go
deleted file mode 100644
index 08e105d..000
--- a/cmd/main.go
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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 main
-
-import (
-   "os"
-
-   "github.com/sirupsen/logrus"
-   "github.com/urfave/cli"
-
-   "github.com/apache/skywalking-cli/logger"
-)
-
-var log *logrus.Logger
-
-func init() {
-   log = logger.Log
-}
-
-func main() {
-   app := cli.NewApp()
-   app.Flags = []cli.Flag{
-   cli.StringFlag{
-   Name:  "config, c",
-   Usage: "path of settings.yml config. Use the file in 
the same folder as default.",
-   },
-   }
-   app.Commands = []cli.Command{serviceCmd}
-
-   err := app.Run(os.Args)
-   if err != nil {
-   log.Fatal(err)
-   }
-}
diff --git a/cmd/service.go b/cmd/service.go
deleted file mode 100644
index 8513965..000
--- a/cmd/service.go
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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 main
-
-import (
-   "github.com/apache/skywalking-cli/swctl/service"
-   "github.com/urfave/cli"
-)
-
-var serviceCmd = cli.Command{
-   Name: "service",
-   Flags: []cli.Flag{
-   cli.BoolFlag{
-   Name:  "list",
-   Usage: "list all available services.",
-   },
-   },
-   Action: func(c *cli.Context) {
-   ctl := service.NewService(c)
-
-   err := ctl.Exec()
-   if err != nil {
-   log.Fatal(err)
-   }
-   },
-}
diff --git a/swctl/service/list.go b/swctl/service/list.go
deleted file mode 100644
index 431032f..000
--- a/swctl/service/list.go
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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 service
-
-func (s *service) showList() error {
-   return nil
-}
diff --git a/swctl/service/service.go b/swctl/service/service.go
deleted file mode 100644
index 

[GitHub] [skywalking-cli] wu-sheng merged pull request #6: [Feature] Set GraphQL client and add service ls command

2019-11-09 Thread GitBox
wu-sheng merged pull request #6: [Feature] Set GraphQL client and add service 
ls command
URL: https://github.com/apache/skywalking-cli/pull/6
 
 
   


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


With regards,
Apache Git Services


[skywalking-cli] 11/25: Create .asf.yaml

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 8e8de7a15e3b681484a7311c8432552fe5338876
Author: kezhenxu94 
AuthorDate: Wed Nov 6 23:23:31 2019 +0800

Create .asf.yaml
---
 .asf.yaml | 9 +
 1 file changed, 9 insertions(+)

diff --git a/.asf.yaml b/.asf.yaml
new file mode 100644
index 000..3f2645a
--- /dev/null
+++ b/.asf.yaml
@@ -0,0 +1,9 @@
+github:
+  description: Apache SkyWalking CLI
+  homepage: https://skywalking.apache.org/
+  labels:
+- skywalking
+- observability
+- apm
+- distributed-tracing
+- cli



[skywalking-cli] 06/25: Update go.yml

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 69cf83391952067f57e954c808d38c4a05a246fe
Author: kezhenxu94 
AuthorDate: Wed Nov 6 21:52:04 2019 +0800

Update go.yml
---
 .github/workflows/go.yml | 16 
 1 file changed, 16 insertions(+)

diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 62aa1dd..a3a570e 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -1,3 +1,19 @@
+# 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.
+
 name: Go
 on: [push, pull_request]
 jobs:



[skywalking-cli] 14/25: Motivation:

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 298aff8b4cd0fe3d3c432d569eb29c47a8da2a6e
Author: kezhenxu94 
AuthorDate: Thu Nov 7 19:05:13 2019 +0800

Motivation:

Set up the graphql client, schema and implement a service command
for reference

Modifications:

- Set up GraphQL client
- Implement service ls command

Result:

GraphQL client can be reused by other commands
---
 .asf.yaml   |  17 +
 .github/workflows/go.yml|  32 +-
 Makefile|  24 +-
 cmd/main.go |  32 --
 cmd/service.go  |  24 --
 commands/interceptor.go |  71 +
 commands/model.go   |  49 +++
 commands/service/list.go|  73 +
 commands/service/service.go |  32 ++
 config/config.go|  25 ++
 go.mod  |   3 +-
 go.sum  |   5 +
 graphql/client/client.go|  51 +++
 graphql/schema/schema.go| 750 
 logger/log.go   |  18 ++
 scripts/build   |  19 +-
 swctl/main.go   |  86 +
 swctl/service/list.go   |   5 -
 swctl/service/service.go|  24 --
 19 files changed, 1233 insertions(+), 107 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index 3f2645a..c1f6dfa 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -1,3 +1,20 @@
+#
+# 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.
+#
+
 github:
   description: Apache SkyWalking CLI
   homepage: https://skywalking.apache.org/
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index bdc008c..1abc12e 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -23,22 +23,22 @@ jobs:
 runs-on: ubuntu-latest
 steps:
 
-- name: Set up Go 1.13
-  uses: actions/setup-go@v1
-  with:
-go-version: 1.13
-  id: go
+  - name: Set up Go 1.13
+uses: actions/setup-go@v1
+with:
+  go-version: 1.13
+id: go
 
-- name: Check out code into the Go module directory
-  uses: actions/checkout@v1
+  - name: Check out code into the Go module directory
+uses: actions/checkout@v1
 
-- name: Get dependencies
-  run: |
-go get -v -t -d ./...
-if [ -f Gopkg.toml ]; then
-curl 
https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
-dep ensure
-fi
+  - name: Get dependencies
+run: |
+  go get -v -t -d ./...
+  if [ -f Gopkg.toml ]; then
+  curl 
https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
+  dep ensure
+  fi
 
-- name: Build
-  run: make
+  - name: Build
+run: make
diff --git a/Makefile b/Makefile
index aa368e7..3273175 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,25 @@
-# Example:
-#   make build
-#   make install
+#
+# 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.
+#
 
 .PHONY: build install
 
 build:
GO_BUILD_FLAGS="-v" ./scripts/build
-   ./bin/swctl --version
\ No newline at end of file
+   ./bin/swctl --version
+
+clean:
+   -rm -rf ./bin
\ No newline at end of file
diff --git a/cmd/main.go b/cmd/main.go
deleted file mode 100644
index e4969db..000
--- a/cmd/main.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package main
-
-import (
-   "os"
-
-   

[skywalking-cli] 23/25: Polish if-else branches

2019-11-09 Thread wusheng
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git

commit 5535cc7de9241090d86a817d2f4ea0c6081aafb9
Author: kezhenxu94 
AuthorDate: Sat Nov 9 21:58:53 2019 +0800

Polish if-else branches
---
 commands/interceptor/duration.go | 14 ++
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/commands/interceptor/duration.go b/commands/interceptor/duration.go
index def8e20..4207011 100644
--- a/commands/interceptor/duration.go
+++ b/commands/interceptor/duration.go
@@ -104,27 +104,17 @@ func ParseDuration(start string, end string) (time.Time, 
time.Time, schema.Step)
}
 
return startTime, endTime, step
-   }
-
-   // end is absent
-   if len(end) == 0 {
+   } else if len(end) <= 0 { // end is absent
if step, startTime, err = tryParseTime(start); err != nil {
logger.Log.Fatalln("Unsupported time format:", start, 
err)
}
return startTime, startTime.Add(30 * stepDuration[step]), step
-   }
-
-   // start is present
-   if len(start) == 0 {
+   } else { // start is present
if step, endTime, err = tryParseTime(end); err != nil {
logger.Log.Fatalln("Unsupported time format:", end, err)
}
return endTime.Add(-30 * stepDuration[step]), endTime, step
}
-
-   logger.Log.Fatalln("Should never happen")
-
-   return startTime, endTime, step
 }
 
 // AlignPrecision aligns the two time strings to same precision



  1   2   >