Skip to content

Commit

Permalink
feat: trace/watch/stack/monitor method-pattern 特殊字符增加等号(=)和点号(.)
Browse files Browse the repository at this point in the history
实际操作等号(=)和点号(.)更友好
  • Loading branch information
qxo committed Oct 27, 2023
1 parent 44adc44 commit b96eb91
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public void setMethodPattern(final String methodPattern) {

@Override
protected void enhance(final CommandProcess process) {
if ("~".equals(methodPattern)) { //smart way
final Pattern smartPattern = Pattern.compile("([.][A-Z][^.]*)([.:])([a-z][^. ]*)$");
if ("=".equals(methodPattern) || "~".equals(methodPattern) || ".".equals(methodPattern)) { //smart way
final Pattern smartPattern = Pattern.compile("([.][A-Z][^.]*)([.: ]+)([a-z][^. ]*)$");
final Matcher matcher = smartPattern.matcher(classPattern);
if (matcher.find()) {
methodPattern = matcher.group(3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
@Summary("Monitor method execution statistics, e.g. total/success/failure count, average rt, fail rate, etc. ")
@Description("\nExamples:\n" +
" monitor org.apache.commons.lang.StringUtils isBlank\n" +
" monitor org.apache.commons.lang.StringUtils.isBlank ~\n" +
" monitor org.apache.commons.lang.StringUtils:isBlank ~\n" +
" monitor org.apache.commons.lang.StringUtils.isBlank =\n" +
" monitor org.apache.commons.lang.StringUtils:isBlank =\n" +
" monitor org.apache.commons.lang.StringUtils isBlank -c 5\n" +
" monitor org.apache.commons.lang.StringUtils isBlank params[0]!=null\n" +
" monitor -b org.apache.commons.lang.StringUtils isBlank params[0]!=null\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
@Summary("Display the stack trace for the specified class and method")
@Description(Constants.EXPRESS_DESCRIPTION + Constants.EXAMPLE +
" stack org.apache.commons.lang.StringUtils isBlank\n" +
" stack org.apache.commons.lang.StringUtils.isBlank ~\n" +
" stack org.apache.commons.lang.StringUtils:isBlank ~\n" +
" stack org.apache.commons.lang.StringUtils.isBlank =\n" +
" stack org.apache.commons.lang.StringUtils:isBlank =\n" +
" stack *StringUtils isBlank\n" +
" stack *StringUtils isBlank params[0].length==1\n" +
" stack *StringUtils isBlank '#cost>100'\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
@Summary("Trace the execution time of specified method invocation.")
@Description(value = Constants.EXPRESS_DESCRIPTION + Constants.EXAMPLE +
" trace org.apache.commons.lang.StringUtils isBlank\n" +
" trace org.apache.commons.lang.StringUtils.isBlank ~\n" +
" trace org.apache.commons.lang.StringUtils:isBlank ~\n" +
" trace org.apache.commons.lang.StringUtils.isBlank =\n" +
" trace org.apache.commons.lang.StringUtils:isBlank =\n" +
" trace *StringUtils isBlank\n" +
" trace *StringUtils isBlank params[0].length==1\n" +
" trace *StringUtils isBlank '#cost>100'\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
@Summary("Display the input/output parameter, return object, and thrown exception of specified method invocation")
@Description(Constants.EXPRESS_DESCRIPTION + "\nExamples:\n" +
" watch org.apache.commons.lang.StringUtils isBlank\n" +
" watch org.apache.commons.lang.StringUtils.isBlank ~\n" +
" watch org.apache.commons.lang.StringUtils:isBlank ~\n" +
" watch org.apache.commons.lang.StringUtils.isBlank =\n" +
" watch org.apache.commons.lang.StringUtils:isBlank =\n" +
" watch org.apache.commons.lang.StringUtils isBlank '{params, target, returnObj, throwExp}' -x 2\n" +
" watch *StringUtils isBlank params[0] params[0].length==1\n" +
" watch *StringUtils isBlank params '#cost>100'\n" +
Expand Down

0 comments on commit b96eb91

Please sign in to comment.