hi,all
I've upgraded the version to 1.0.1-SNAPSHOT.
And added a new function ref-stats to get the statistics information of a
reference.For example:

=>(use'stm)
=>(def a (ref 1))
=>(def b (ref 2))
=>(dotimes [_ 100] (future (dosync (alter a + 1) (alter b - 1))))

=>@a
101
=>@b
-98

=>(stm-stats)
{"(alter a + 1)(alter b - 1)" {:not-running 9, :average-retry 15,
:total-cost 3048, :get-fault 52, :barge-fail 372, :change-committed 1064,
:total-times 100, :average-cost 30}}

=>(ref-stats a)
{"(alter a + 1)(alter b - 1)" {:alter 1601, :get-fault 52, :barge-fail 372,
:change-committed 1064}}

We can get a detail information of a reference involed in a tranaction.The
:alter means it was invoked with alter 1601 times including retry times.
:get-fault means we can't get a committed value before the transaction read
point,so we have to retry it. :change-commited means that other transaction
has commited a new value of this reference before our transaction,so we
have to retry it again. :barge-fail means we wanted to barge other
transaction,but we failed,we still have to retry the transaction.

2012/1/16 Jonathan Cardoso <jonathancar...@gmail.com>

> Interesting!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en




-- 
庄晓丹
Email:        killme2...@gmail.com
伯岩(花名)  bo...@taobao.com
Site:           http://fnil.net

淘宝(中国)软件有限公司 / 产品技术部 / Java中间件

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to