I decided I wanted to be able to see some stats about my little app, so I
added this function:
(defn show-stats-regarding-resources-used-by-this-app [request]
(response (apply str "Memory in use (percentage/used/max-heap): "
(who/memory-usage) " CPU usage (how-many-cpu's/load-average): "
(who/cpu-load-usage) " free memory in jvm: " (conj []
(who/free-memory-in-jvm)))))
This worked great, but then I decided to add this to the end:
" How many people are logged in: " (str (count @registry))
The registry is defined as:
(def registry (atom {}))
And this map keeps maps inside of it, one for each user, so it is a 2D map.
Now Ihave this and I get errors:
(defn show-stats-regarding-resources-used-by-this-app [request]
(response (apply str "Memory in use (percentage/used/max-heap): "
(who/memory-usage) " CPU usage (how-many-cpu's/load-average): "
(who/cpu-load-usage) " free memory in jvm: " (conj []
(who/free-memory-in-jvm)) " How many people are logged in: " (str (count
@registry)))))
I get:
2012-10-29 12:15:02.045:WARN:oejs.AbstractHttpConnection:/show-resources
java.lang.IllegalArgumentException: Don't know how to create ISeq from:
java.lang.Long
I tried this with and without the "str". What is wrong with this?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en