How to export Gerrit data

947 views
Skip to first unread message

詹康宝

unread,
Jun 19, 2020, 5:21:21 AM6/19/20
to Repo and Gerrit Discussion
  Currently we use Gerrit v2.15.3
  
  we can use the gsql command to export some tables, for example: changes, change_message;
  
  If upgrade to a version after Gerrit V3 which uses NoteDB, how do I get these basic data tables?

  Can it only get the full amount data through Rest API/SSH API?
  
  Is there a better way to get the data?
  
  We did some data analysis based on these basic data, such as the average review time of the review, etc.So we have to give full consideration to complete the upgrade

Luca Milanesio

unread,
Jun 19, 2020, 5:26:14 AM6/19/20
to 詹康宝, Luca Milanesio, Repo and Gerrit Discussion

On 19 Jun 2020, at 10:21, 詹康宝 <qq778...@gmail.com> wrote:

  Currently we use Gerrit v2.15.3
  
  we can use the gsql command to export some tables, for example: changes, change_message;
  
  If upgrade to a version after Gerrit V3 which uses NoteDB, how do I get these basic data tables?

You don’t, as there isn’t a data-base anymore.
NoteDb isn’t a “proper DBMS” and doesn’t include any query language I’m afraid.

However, you can still use the indexes to get some data, but not all of it.


  Can it only get the full amount data through Rest API/SSH API?

Yes, you could, but it would really overload the server.

  
  Is there a better way to get the data?

We are improving the analytics plugin to extract that data. But the coverage is still low at the moment.

HTH

Luca.

  
  We did some data analysis based on these basic data, such as the average review time of the review, etc.So we have to give full consideration to complete the upgrade

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/cdb2ec09-168c-47d3-ae4f-aa27abcdf08ao%40googlegroups.com.

詹康宝

unread,
Jun 22, 2020, 4:02:48 AM6/22/20
to Repo and Gerrit Discussion
thx Luca
I will read the documentation of the analytics plugin

在 2020年6月19日星期五 UTC+8下午5:26:14,lucamilanesio写道:


On 19 Jun 2020, at 10:21, 詹康宝 <qq778...@gmail.com> wrote:

  Currently we use Gerrit v2.15.3
  
  we can use the gsql command to export some tables, for example: changes, change_message;
  
  If upgrade to a version after Gerrit V3 which uses NoteDB, how do I get these basic data tables?

You don’t, as there isn’t a data-base anymore.
NoteDb isn’t a “proper DBMS” and doesn’t include any query language I’m afraid.

However, you can still use the indexes to get some data, but not all of it.


  Can it only get the full amount data through Rest API/SSH API?

Yes, you could, but it would really overload the server.

  
  Is there a better way to get the data?

We are improving the analytics plugin to extract that data. But the coverage is still low at the moment.

HTH

Luca.
  
  We did some data analysis based on these basic data, such as the average review time of the review, etc.So we have to give full consideration to complete the upgrade

--
--

More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-d...@googlegroups.com.

qq778...@gmail.com

unread,
Jul 22, 2020, 10:34:40 PM7/22/20
to Repo and Gerrit Discussion
according to  https://gerrit.googlesource.com/homepage/+/md-pages/docs/Notedb.md 

I can use the git log refs/changes/01/101/meta command to get some information about the changes, 

but how do I get detail comments? In the git log, it only displays (x comments) 

git log like this:
[root@gerrit-kanbao xx.git]# git log refs/changes/01/101/meta 
commit 64d7f421facc7ad162587049a3c2b5b67f8820f8
Author: Gerrit User 1000000 <1000000@bc73f120-cc98-42fa-aac4-7788e2a8a6d9>
Date:   Wed Jul 22 22:06:33 2020 -0400

    Update patch set 2
    
    Patch Set 2: -Verified
    
    (1 comment)
    
    Patch-set: 2
    Reviewer: Gerrit User 1000000 <1000000@bc73f120-cc98-42fa-aac4-7788e2a8a6d9>
    Label: Verified=0

commit 7b0ecbef7d3cc313616b448de91f5c0e4d689dab
Author: Gerrit User 1000000 <1000000@bc73f120-cc98-42fa-aac4-7788e2a8a6d9>
Date:   Wed Jul 15 01:55:34 2020 -0400

    Update patch set 2
    
    Patch Set 2: Verified+1
    
    Build Successful
    
    
    Patch-set: 2
    Tag: autogenerated:jenkins-gerrit-trigger
    Reviewer: Gerrit User 1000000 <1000000@bc73f120-cc98-42fa-aac4-7788e2a8a6d9>
    Label: Verified=+1

Saša Živkov

unread,
Jul 23, 2020, 7:57:32 AM7/23/20
to qq778...@gmail.com, Repo and Gerrit Discussion
On Thu, Jul 23, 2020 at 4:34 AM qq778...@gmail.com <qq778...@gmail.com> wrote:
according to  https://gerrit.googlesource.com/homepage/+/md-pages/docs/Notedb.md 

I can use the git log refs/changes/01/101/meta command to get some information about the changes, 

but how do I get detail comments? In the git log, it only displays (x comments) 
The inline comments are stored inside the tree of each commit. 
You can use the --patch option of the git log to display which comments were added in that commit:

$ git log --patch refs/changes/01/101/meta


qq778...@gmail.com

unread,
Jul 23, 2020, 10:58:58 PM7/23/20
to Repo and Gerrit Discussion
grateful!!!

qq778...@gmail.com

unread,
Jul 23, 2020, 11:08:25 PM7/23/20
to Repo and Gerrit Discussion
Are there any good suggestions for parsing these logs? 

Should I read the Gerrit source code to see the analysis of this part? 

Does Gerrit REST API also use this method?

Han-Wen Nienhuys

unread,
Jul 27, 2020, 6:29:54 AM7/27/20
to qq778...@gmail.com, Repo and Gerrit Discussion
On Fri, Jul 24, 2020 at 5:08 AM qq778...@gmail.com
<qq778...@gmail.com> wrote:
>
> Are there any good suggestions for parsing these logs?
>
> Should I read the Gerrit source code to see the analysis of this part?
>
> Does Gerrit REST API also use this method?

Gerrit parses these data, yes.

We don't have published code (except for Gerrit itself) that will help
you parse this data, but in practice, I expect that the format will
not change, because migrating data is a lot of work.

That said, the easiest way to make sense of existing dump of the data,
is to simply run Gerrit on the data, and look at it using the REST
API.

>>> $ git log --patch refs/changes/01/101/meta
>>>
>>>
>>>>
>>>> git log like this:
>>>> [root@gerrit-kanbao xx.git]# git log refs/changes/01/101/meta
>>>> commit 64d7f421facc7ad162587049a3c2b5b67f8820f8
>>>> Author: Gerrit User 1000000 <1000000@bc73f120-cc98-42fa-aac4-7788e2a8a6d9>
>>>> Date: Wed Jul 22 22:06:33 2020 -0400
>>>>
>>>> Update patch set 2
>>>>
>>>> Patch Set 2: -Verified
>>>>
>>>> (1 comment)
>>>>
>>>> Patch-set: 2
>>>> Reviewer: Gerrit User 1000000 <1000000@bc73f120-cc98-42fa-aac4-7788e2a8a6d9>
>>>> Label: Verified=0
>>>>
>>>> commit 7b0ecbef7d3cc313616b448de91f5c0e4d689dab
>>>> Author: Gerrit User 1000000 <1000000@bc73f120-cc98-42fa-aac4-7788e2a8a6d9>
>>>> Date: Wed Jul 15 01:55:34 2020 -0400
>>>>
>>>> Update patch set 2
>>>>
>>>> Patch Set 2: Verified+1
>>>>
>>>> Build Successful
>>>>
>>>> http://172.29.53.101:8888/job/patch_set_created/3/ : SUCCESS
>>>>
>>>> Patch-set: 2
>>>> Tag: autogenerated:jenkins-gerrit-trigger
>>>> Reviewer: Gerrit User 1000000 <1000000@bc73f120-cc98-42fa-aac4-7788e2a8a6d9>
>>>> Label: Verified=+1


--
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

Luca Milanesio

unread,
Jul 27, 2020, 6:31:52 AM7/27/20
to Repo and Gerrit Discussion, Luca Milanesio, qq778...@gmail.com, Han-Wen Nienhuys


> On 27 Jul 2020, at 12:29, 'Han-Wen Nienhuys' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:
>
> On Fri, Jul 24, 2020 at 5:08 AM qq778...@gmail.com
> <qq778...@gmail.com> wrote:
>>
>> Are there any good suggestions for parsing these logs?
>>
>> Should I read the Gerrit source code to see the analysis of this part?
>>
>> Does Gerrit REST API also use this method?
>
> Gerrit parses these data, yes.
>
> We don't have published code (except for Gerrit itself) that will help
> you parse this data, but in practice, I expect that the format will
> not change, because migrating data is a lot of work.
>
> That said, the easiest way to make sense of existing dump of the data,
> is to simply run Gerrit on the data, and look at it using the REST
> API.

Remember to align the ’serverId’ with the existing Gerrit server and run the off-line reindex, so that Gerrit can read, parse and create the Lucene index for those changes.

HTH

Luca.
> --
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/CAFQ2z_OWkcPp%2B1vfqYBPL3zf4jt7_MJ1sSSDD7nG%2B37uH_mTPw%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages