forked from levand/perfstats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Luke VanderHart
committed
Jun 15, 2011
1 parent
5a58732
commit e1fc099
Showing
4 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
luke@new-host-2.home.57341 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters