Skip to content

Commit

Permalink
EOD checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke VanderHart committed Jun 15, 2011
1 parent 5a58732 commit e1fc099
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
1 change: 1 addition & 0 deletions samplescripts/.#test3.clj
3 changes: 1 addition & 2 deletions samplescripts/test3.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

(pp/pprint (first user/*samples*))


(with-data samples
(view (scatter-plot ($ :start-time) ($ :latency)))
(view (histogram ($ :latency))))
(view (histogram ($ :latency) :nbins 50)))



37 changes: 37 additions & 0 deletions samplescripts/test4.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
(ns test4
(:use [incanter core stats charts])
(:require [clojure.pprint :as pp]))

(pp/pprint (first user/*samples*))

(def my-samples (map (fn [r] (assoc r :threadcount (Integer/parseInt (re-find #"^\d+" (:thread-name r))))) user/*samples*))
(def samples (dataset (keys (first my-samples)) (drop 3 my-samples)))


(println (distinct (map :group-threads my-samples)))


(defn report-group [key group]
(with-data group
(println "key: " key)
(println "Count: " (count ($ :latency)))))

(def trimmed-data ($where {:latency {:$lt (first (quantile ($ :latency samples) :probs [0.99]))}} samples))

(with-data trimmed-data

(view (scatter-plot ($ :latency) ($ :threadcount) ))

(let [groups ($group-by [:threadcount])]
(doseq [[k v] groups]
(report-group k v)))


(println "Groups" (count ($group-by [:group-threads])))
(println "Number of samples:" (count ($ :latency)))
(println "Quantile of latency:" (quantile ($ :latency) :probs [0.99 0.95 0.9]))
(println "Min Latency:" (reduce min ($ :latency)))
(println "Max latency:" (reduce max ($ :latency)))
(println "Mean latency:" (mean ($ :latency)))
(println "Standard deviation:" (sd ($ :latency))))

5 changes: 3 additions & 2 deletions src/perfstats/PerfstatVisualizer.clj
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@

(extend-type SampleResult
Sample
(to-map [sample] {:start-time (.getStartTime sample)
(to-map [sample] {
:start-time (.getStartTime sample)
:end-time (.getEndTime sample)
:label (.getSampleLabel sample)
:successful (.isSuccessful sample)
:code (.getResponseCode sample)
:url (.getUrlAsString sample)
:monitor (.isMonitor sample)
:size (.getBytes sample)
:group-threads (.getGroupThreads sample)
:thread-name (.getThreadName sample)
:latency (.getLatency sample)
Expand Down Expand Up @@ -80,7 +82,6 @@
label)

(defn -clearData [this]
(println "current state:" @(.state this))
(println "clear"))

(defn -init [this]
Expand Down

0 comments on commit e1fc099

Please sign in to comment.