diff --git a/basis/tools/profiler/sampling/authors.txt b/basis/tools/profiler/sampling/authors.txt new file mode 100644 index 0000000000..f13c9c1e77 --- /dev/null +++ b/basis/tools/profiler/sampling/authors.txt @@ -0,0 +1 @@ +Joe Groff diff --git a/basis/tools/profiler/sampling/sampling-tests.factor b/basis/tools/profiler/sampling/sampling-tests.factor new file mode 100644 index 0000000000..fabd7725ca --- /dev/null +++ b/basis/tools/profiler/sampling/sampling-tests.factor @@ -0,0 +1,15 @@ +USING: byte-arrays calendar kernel math memory namespaces +random threads tools.profiler.sampling +tools.profiler.sampling.private tools.test ; +IN: tools.profiler.sampling.tests + +! Make sure the profiler doesn't blow up the VM +TUPLE: boom ; +{ } [ 10 [ [ ] profile ] times ] unit-test +[ 10 [ [ boom new throw ] profile ] times ] [ boom? ] must-fail-with +{ } [ 10 [ [ 100 [ 1000 random (byte-array) drop ] times gc ] profile ] times ] unit-test +{ } [ 2 [ [ 1 seconds sleep ] profile ] times ] unit-test + +(clear-samples) +f raw-profile-data set-global +gc diff --git a/basis/tools/profiler/sampling/sampling.factor b/basis/tools/profiler/sampling/sampling.factor index ea4a311efb..4d71a14bc5 100644 --- a/basis/tools/profiler/sampling/sampling.factor +++ b/basis/tools/profiler/sampling/sampling.factor @@ -1,3 +1,4 @@ +! (c)2011 Joe Groff bsd license USING: assocs calendar continuations kernel math.statistics namespaces sequences tools.profiler.sampling.private ; IN: tools.profiler.sampling diff --git a/basis/tools/profiler/sampling/summary.txt b/basis/tools/profiler/sampling/summary.txt new file mode 100644 index 0000000000..9d7948b4a2 --- /dev/null +++ b/basis/tools/profiler/sampling/summary.txt @@ -0,0 +1 @@ +Sampling profiler