{"action":"created","issue":{"url":"https://api.github.com/repos/alibaba/arthas/issues/71","repository_url":"https://api.github.com/repos/alibaba/arthas","labels_url":"https://api.github.com/repos/alibaba/arthas/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/arthas/issues/71/comments","events_url":"https://api.github.com/repos/alibaba/arthas/issues/71/events","html_url":"https://github.com/alibaba/arthas/issues/71","id":361624105,"node_id":"MDU6SXNzdWUzNjE2MjQxMDU=","number":71,"title":"Arthas的一些特殊用法文档说明","user":{"login":"hengyunabc","id":1683936,"node_id":"MDQ6VXNlcjE2ODM5MzY=","avatar_url":"https://avatars2.githubusercontent.com/u/1683936?v=4","gravatar_id":"","url":"https://api.github.com/users/hengyunabc","html_url":"https://github.com/hengyunabc","followers_url":"https://api.github.com/users/hengyunabc/followers","following_url":"https://api.github.com/users/hengyunabc/following{/other_user}","gists_url":"https://api.github.com/users/hengyunabc/gists{/gist_id}","starred_url":"https://api.github.com/users/hengyunabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hengyunabc/subscriptions","organizations_url":"https://api.github.com/users/hengyunabc/orgs","repos_url":"https://api.github.com/users/hengyunabc/repos","events_url":"https://api.github.com/users/hengyunabc/events{/privacy}","received_events_url":"https://api.github.com/users/hengyunabc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-19T07:56:25Z","updated_at":"2018-09-19T07:57:30Z","closed_at":null,"author_association":"COLLABORATOR","body":"收集Arthas里的一些特殊用法。\r\n\r\nognl表达式官网：https://commons.apache.org/proper/commons-ognl/language-guide.html"},"comment":{"url":"https://api.github.com/repos/alibaba/arthas/issues/comments/422698095","html_url":"https://github.com/alibaba/arthas/issues/71#issuecomment-422698095","issue_url":"https://api.github.com/repos/alibaba/arthas/issues/71","id":422698095,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjY5ODA5NQ==","user":{"login":"hengyunabc","id":1683936,"node_id":"MDQ6VXNlcjE2ODM5MzY=","avatar_url":"https://avatars2.githubusercontent.com/u/1683936?v=4","gravatar_id":"","url":"https://api.github.com/users/hengyunabc","html_url":"https://github.com/hengyunabc","followers_url":"https://api.github.com/users/hengyunabc/followers","following_url":"https://api.github.com/users/hengyunabc/following{/other_user}","gists_url":"https://api.github.com/users/hengyunabc/gists{/gist_id}","starred_url":"https://api.github.com/users/hengyunabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hengyunabc/subscriptions","organizations_url":"https://api.github.com/users/hengyunabc/orgs","repos_url":"https://api.github.com/users/hengyunabc/repos","events_url":"https://api.github.com/users/hengyunabc/events{/privacy}","received_events_url":"https://api.github.com/users/hengyunabc/received_events","type":"User","site_admin":false},"created_at":"2018-09-19T07:57:30Z","updated_at":"2018-09-19T07:57:30Z","author_association":"COLLABORATOR","body":"#### 查看第一个参数：\r\n\r\n```\r\n$ watch com.taobao.container.Test test \"params[0]\"\r\nPress Ctrl+C to abort.\r\nAffect(class-cnt:1 , method-cnt:1) cost in 34 ms.\r\n@ArrayList[\r\n    @Pojo[com.taobao.container.Test$Pojo@75a1cd57],\r\n\r\n    @Pojo[com.taobao.container.Test$Pojo@3d012ddd],\r\n\r\n    @Pojo[com.taobao.container.Test$Pojo@6f2b958e],\r\n\r\n    @Pojo[com.taobao.container.Test$Pojo@1eb44e46],\r\n\r\n    @Pojo[com.taobao.container.Test$Pojo@6504e3b2],\r\n```\r\n\r\n#### 查看第一个参数的size：\r\n\r\n```\r\n$ watch com.taobao.container.Test test \"params[0].size()\"\r\nPress Ctrl+C to abort.\r\nAffect(class-cnt:1 , method-cnt:1) cost in 22 ms.\r\n@Integer[40]\r\n```\r\n\r\n#### 将结果按name属性投影：\r\n\r\n```\r\n$ watch com.taobao.container.Test test \"params[0].{ #this.name }\"\r\nPress Ctrl+C to abort.\r\nAffect(class-cnt:1 , method-cnt:1) cost in 25 ms.\r\n@ArrayList[\r\n    @String[name 0],\r\n\r\n    @String[name 1],\r\n\r\n```\r\n\r\n#### 按条件过滤：\r\n\r\n```\r\n$ watch com.taobao.container.Test test \"params[0].{? #this.name == null }\" -x 2\r\nPress Ctrl+C to abort.\r\nAffect(class-cnt:1 , method-cnt:1) cost in 27 ms.\r\n@ArrayList[\r\n    @Pojo[\r\n        name=null,\r\n        age=@Integer[32],\r\n        hobby=null,\r\n    ],\r\n]\r\n@ArrayList[\r\n    @Pojo[\r\n        name=null,\r\n        age=@Integer[31],\r\n        hobby=null,\r\n    ],\r\n]\r\n\r\n$ watch com.taobao.container.Test test \"params[0].{? #this.name != null }\" -x 2\r\nPress Ctrl+C to abort.\r\nAffect(class-cnt:1 , method-cnt:1) cost in 24 ms.\r\n@ArrayList[\r\n    @Pojo[\r\n        name=@String[name 1],\r\n        age=@Integer[3],\r\n        hobby=null,\r\n    ],\r\n\r\n```\r\n\r\n#### 过滤后统计：\r\n\r\n```\r\n$ watch com.taobao.container.Test test \"params[0].{? #this.age > 10 }.size()\" -x 2\r\nPress Ctrl+C to abort.\r\nAffect(class-cnt:1 , method-cnt:1) cost in 29 ms.\r\n@Integer[31]\r\n@Integer[31]\r\n```"}}
{"actor":{"display_login":"hengyunabc"}}