Skip to content

Instantly share code, notes, and snippets.

@rightfold
Created January 4, 2015 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rightfold/16b93419da3aed9c11ef to your computer and use it in GitHub Desktop.
Save rightfold/16b93419da3aed9c11ef to your computer and use it in GitHub Desktop.
(defn ^:private ping-status [line]
(cond-let match
(re-find #"time=([0-9.]+)" line)
[:ok (-> (second match) Float/parseFloat (* 1e6) Duration/ofNanos)]
(re-find #"timeout" line)
[:error :timeout]
:else
[:error :unknown]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment