简体   繁体   中英

How to get number of tasks each user holds in gerrit queue via gsql

for gerrit tasks queue, I can get the status of queue via

ssh -p 29418 localhost gerrit show-queue -w

Can we get the number of tasks each user holds via gsql?

Or any other solution for this?

Thanks a lot

Yes you can, but i would not use qsql as it is for administration purposes. use gerrit query instead like this

# this will count all open issues on the server 
ssh -l username -p 29418 gerritserver gerrit query --format json "status:open" | wc -l
# this will count all open issues for user rvoss on the server 
ssh -l username -p 29418 gerritserver gerrit query --format json "status:open owner=rvoss" | wc -l

If you leave out the |wc -l you will see the json objects comming down and you can fairly easy pass that information and generate the stats you want.

Be aware that usually you will only get 500 result at a time so if there is more results you have to query again with provide sortkey, to continue retrieving the information. But that information is available in the help link.

https://gerrit-documentation.googlecode.com/svn/Documentation/2.7/json.html?_sm_au_=iMVMhZRZ2rQ7rZ7M#account

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM