public static JSONObject getJSONObject(SampleEvent evt) {
        SampleResult res = evt.getResult();
        long t = res.getTime();
        long lt = res.getLatency();
        long ts = res.getTimeStamp();
        boolean s = res.isSuccessful();
        String lb = escape(res.getSampleLabel());
        String rc = escape(res.getResponseCode());
        String rm = escape(res.getResponseMessage());
        String tn = escape(res.getThreadName());
        String dt = escape(res.getDataType());
        int by = res.getBytes();
        int sc = res.getSampleCount();
        int ec = res.getErrorCount();
        int ng = res.getGroupThreads();
        int na = res.getAllThreads();
        String localHostName = JMeterUtils.getLocalHostFullName();
        String hn = XML.escape(localHostName != null ? localHostName : "localhost");
        long in = res.getIdleTime();

        JSONObject httpSample = new JSONObject();
        try {
            httpSample.put("t", t);
            httpSample.put("lt", lt);
            httpSample.put("lt", lt);
            httpSample.put("ts", ts);
            httpSample.put("s", s);
            httpSample.put("lb", lb);
            httpSample.put("rc", rc);
            httpSample.put("rm", rm);
            httpSample.put("tn", tn);
            httpSample.put("dt", dt);
            httpSample.put("by", by);
            httpSample.put("sc", sc);
            httpSample.put("ec", ec);
            httpSample.put("ng", ng);
            httpSample.put("na", na);
            httpSample.put("hn", hn);
            httpSample.put("in", in);

        } catch (JSONException je) {
            BmLog.error("Error while converting sample to JSONObject");
        }
        return httpSample;
    }