mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
031d404a34
Summary: This adds a config option that can be enabled to profile what is happening when the sqlock is taken (since that is the time spent that limits how fast we can accept commits). It writes the profile out to an external file for reading. Test Plan: Added a test. Also manually copied this to an hg server and did a push. Reviewers: #sourcecontrol, ttung, simonfar Reviewed By: simonfar Subscribers: simonfar Differential Revision: https://phabricator.intern.facebook.com/D3239204 Signature: t1:3239204:1461922938:45298ada2955df8e5e145805f137ccc1974becea
44 lines
838 B
Raku
44 lines
838 B
Raku
$ . "$TESTDIR/library.sh"
|
|
|
|
# Populate the db with an initial commit
|
|
|
|
$ initclient client
|
|
$ cd client
|
|
$ echo x > x
|
|
$ hg commit -qAm x
|
|
$ cd ..
|
|
|
|
$ initserver master masterrepo
|
|
|
|
# Test with stat profiler
|
|
$ cat >> master/.hg/hgrc <<EOF
|
|
> [hgsql]
|
|
> profiler=stat
|
|
> profileoutput=$TESTTMP/
|
|
> EOF
|
|
|
|
$ cd client
|
|
$ hg push -q ssh://user@dummy/master
|
|
$ cat $TESTTMP/hgsql-profile* | grep "Total Elapsed Time"
|
|
Total Elapsed Time: * (glob)
|
|
$ rm -f $TESTTMP/hgsql-profile*
|
|
|
|
$ cd ..
|
|
|
|
# Test with ls profiler
|
|
$ cat >> master/.hg/hgrc <<EOF
|
|
> [hgsql]
|
|
> profiler=ls
|
|
> profileoutput=$TESTTMP/
|
|
> EOF
|
|
|
|
$ cd client
|
|
$ echo x >> x
|
|
$ hg commit -qAm x
|
|
$ hg push -q ../master
|
|
$ cat $TESTTMP/hgsql-profile* | grep "Total Elapsed Time"
|
|
Total Elapsed Time: * (glob)
|
|
$ rm -f $TESTTMP/hgsql-profile*
|
|
|
|
$ cd ..
|