@Override
    public boolean writeMetricsSync(String content) {
        if (!trySignIn()) {
            Logger.warn("try login fails, so do not continue write content!");
            return false;
        }

        final HttpRequest req = new HttpRequest.Builder()
                .url(writeReqUrl)
                .header("Cookie", cookie)
                .post(content)
                .build();
        try {
            final HttpResponse response = httpClient.execute(req);
            final HttpRespStatus status = response.getStatus();
            if (status.statusClass() == SUCCESS) {
                if (Logger.isDebugEnable()) {
                    Logger.debug("InfluxDbV2Client.writeMetricsSync(): respStatus=" + status.simpleString()
                            + ", reqBody=" + content);
                }
                return true;
            }

            if (status.statusClass() != INFORMATIONAL && status.statusClass() != SUCCESS) {
                Logger.warn("InfluxDbV2Client.writeMetricsSync(): respStatus=" + status.simpleString()
                        + ", reqBody=" + content);
            }
        } catch (IOException e) {
            Logger.warn("InfluxDbV2Client.writeMetricsSync() catch IOException!", e);
        } catch (Throwable t) {
            Logger.error("InfluxDbV2Client.writeMetricsSync() catch Exception!", t);
        }
        return false;
    }
@Test
    public void testWrite() {
        Assert.assertTrue(influxDbClient.writeMetricsSync(
                "cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000\n" +
                        "cpu_load_short,host=server02,region=us-west value=0.96 1434055562000000000"));
    }