-
-
Save rightfold/16b93419da3aed9c11ef to your computer and use it in GitHub Desktop.
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
(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