@Override
    public synchronized void sampleOccurred(SampleEvent sampleEvent) {
        if (SamplesUploader.isRunning()) {
            JSONObject sample = Utils.getJSONObject(sampleEvent);
            SamplesUploader.addSample(sample);
        }
    }