Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

timing library for clojure

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 doc
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 project.clj
README.md

timing

Timing is a simple library to log call time using perf4j.

Usage

[timing "0.1.2"]

timed

Just wrap forms you want to calculate call time:

(timed :tag
  (look-up-db ...)
  (assemble-data ...))

Note that you have to provide a tag to identify these forms in timing log.

Timing will select a logging provider automatically by looking up your classpath (slf4j, log4j and stderr). Timing doesn't depend on any logging provider at compile time.

timed-fn

Convert a predefined function to a timed one.

(defn count-how-many-people-on-the-earth [req]
  )

(defroute my-website
  (GET "/count" (timed-fn count-how-many-people-on-the-earth)))

defn-timed

Define a function who is born to be timed.

(defn-timed count-how-many-ants-on-the-earth [req]
  )

wrap-timed

There's also a built-in ring middleware to log call time for every request. wrap-timed uses uri as timing tags.

(wrap-timed handler)

License

Copyright © 2012 Sun Ning

Distributed under the Eclipse Public License, the same as Clojure.

Something went wrong with that request. Please try again.