changeset 51841:102770bbf270 stable

profiling: use "stat" profiler to profile individual request The ls profiler no longer works for that. As the lsprof profiler is not default and not great is general, lets side step the issue for now.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 11 Sep 2024 12:03:39 +0200
parents 1bb71046f5e0
children 3785814bc2b7 37a079410507
files tests/test-profile.t
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-profile.t	Wed Sep 11 12:02:38 2024 +0200
+++ b/tests/test-profile.t	Wed Sep 11 12:03:39 2024 +0200
@@ -50,11 +50,15 @@
 
 #endif
 
-#if lsprof serve
+#if serve
 
 Profiling of HTTP requests works
 
-  $ prof \
+  $ stats_prof () {
+  >   hg --config profiling.type=stat --profile $@
+  > }
+
+  $ stats_prof \
   >   --config profiling.format=text \
   >   --config profiling.output=../profile.log \
   >  serve -d \
@@ -67,7 +71,9 @@
   $ cat ../error.log
 
 A single profile is logged because file logging doesn't append
-  $ grep CallCount ../profile.log | wc -l
+  $ grep 'Sample count:' ../profile.log | wc -l
+  \s*1 (re)
+  $ grep 'Total time:' ../profile.log | wc -l
   \s*1 (re)
 
 #endif