       (.connectTimeout timeout TimeUnit/MILLISECONDS))))
 
 (defn get-client
-  "Returns an `org.influxdb.InfluxDB` instance"
+  "Returns an `org.influxdb.InfluxDB` instance."
   [{:keys [scheme host port username password] :as opts}]
   (let [url (str scheme "://" host ":" port)]
     (InfluxDBFactory/connect url username password (get-builder opts))))
 
 (defn get-batchpoint
-  "Returns a `org.influxdb.dto.BatchPoints` instance"
+  "Returns a `org.influxdb.dto.BatchPoints` instance."
   [{:keys [tags db retention consistency]}]
   (let [builder (doto (BatchPoints/database db)
                       (.consistency (InfluxDB$ConsistencyLevel/valueOf consistency)))]

(defn partition-events
  "`events` is a list of events.

  partition `events` depending of the `db`, `retention` and `consistency` keys
  returns a list, each element being a list of events (the result of the partitioning)."
  [events]
  (->> (if (sequential? events) events (list events))

    (into-array (list trust-manager))))

(defn get-ssl-factory
  "Get an instance of `javax.net.ssl.SSLSocketFactory`."
  []
  (let [ssl-context (SSLContext/getInstance "TLS")]
    (.init ssl-context nil (get-trust-manager) (new SecureRandom))
    (.getSocketFactory ssl-context)))

(defn get-hostname-verifier
  "Get an instance of `javax.net.ssl.HostnameVerifier`."
  []
  (let [verifier (proxy [HostnameVerifier] []
                   (verify [_ _] true))]
    verifier))

(defn get-builder
  "Returns a new okhttp3.OkHttpClient$Builder."
  [{:keys [timeout insecure]}]
  (let [builder (new okhttp3.OkHttpClient$Builder)]
    (when insecure
