Re: Clojure.org
Thanks for the feedback! Yeggi’s post was written a long time ago and the site/mailing list have undergone quite a few changes since then. Hopefully it is better now, sometimes it is hard for those of us who have been around awhile to see rough edges. Alan -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: When does .getThreadCpuTime return nil?
Thanks for the answer. I am surprised because I used this code for years without ever seeing that error. I'm trying to imagine what I did differently this one time. I've added error detection, we'll see if it happens again. On Friday, September 22, 2017 at 7:34:49 PM UTC-4, Neil Okamoto wrote: > > > Maybe it's because you attempted method invocation via reflection but the > object is nil. So for example if (threads) returns a list containing nils, > then calling (.getId t) or (.getName t) would probably throw a null pointer > exception. I'm not sure it's possible for > (ManagementFactory/getThreadMXBean) to return nil, but if it does then > (.getThreadCpuTime mgr ...) would similarly fail. > > So best guess is, take a look at the implementation of "threads". > > > > > On Friday, September 22, 2017 at 1:37:04 PM UTC-7, lawrence...@gmail.com > wrote: >> >> I've been using this code for years. I copy and pasted it from someone >> else on this group, someone much smarter than I am. I have never seen an >> error from this code. Now suddenly I get a null pointer exception at the >> last line of this code: >> >> (ns denormalize_mysql_to_mongodb.monitoring >> (:import >>java.lang.management.ManagementFactory) >> (:require [clojure.string :as st])) >> >> >> (defn thread-top >> "Return a seq of threads sorted by their total userland CPU usage." >> [] >> (let [mgr (ManagementFactory/getThreadMXBean) >> cpu-times (map (fn [t] >> [(.getThreadCpuTime mgr (.getId t)) t]) >> (threads))] >> (map >> (fn [[cpu t]] [cpu (.getName t) (.getId t) t]) >> (reverse (sort-by first cpu-times) >> >> This error is thrown at startup. I don't know much about ThreadMXBean. >> Can anyone give me a clue why any of this would be nil? >> >> >> >> >> >> -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Is it wrong that I'm thinking about this?
Last I checked, on our Clojure back-end, instrumentation was taking up 2% of our total test running time. This is with jdbc's instrumentation disabled though; I think it's significantly slower due to its extensive usage of s/or s/alt and spec regexes. Our specs are almost entirely s/keys and clojure.core predicates. Our fn spec coverage is 47% on the back-end. So the performance impact of instrumentation really hasn't been a concern. On Fri, Sep 22, 2017 at 10:18:52PM -0700, Didier wrote: > > The goal is to add the macro to orchestra, as a tool to help encourage > > spec'ing all functions. > > That would be great. My macro for now was also not supporting all defn cases > yet. And it automatically instruments the fn with orchestra. So if orchestra > had a more complete one defacto, I wouldn't need one. > > For performance, I've been thinking that caching validation (with some > configurable cache bounds), or having sample based validation, so validating > only a percentage of calls, and maybe even having the sampling rate > controlled by execution time metrics, or cpu metrics or call rates, etc. > would be interesting possibilities. So in prod, you could tweek the > validation to only get as much of it as you can afford. > > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. signature.asc Description: PGP signature
Re: [ANN] Instaparse 1.4.8
Thanks Mark, Instaparse is invaluable for us. Sent from my iPhone > On 23 Sep 2017, at 06:18, Mark Engelbergwrote: > > Instaparse 1.4.8 has been updated to support a breaking change that was made > in Clojurescript 1.9.854, relating to the reader. The change has been tested > with Clojurescript versions 1.7.28 and up. > > No functionality changes, and this update should not matter for Clojure users. > Instaparse supports Clojure 1.5.1 and up. > > Thanks to pkpkpk for providing the pull request with the necessary fix: > https://github.com/Engelberg/instaparse/pull/169 > > (Please note that Clojurescript does not currently work with Clojure > 1.9-alpha20 or newer: https://dev.clojure.org/jira/browse/CLJS-2352) > > --Mark > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.