private void flush() {
        synchronized (lock) {
            try {
                if (rows != null && rows.size() > 0) {
                    LOG.debug("Flushing {} records to redis...", rows.size());
                    flushInternal(rows);
                    LOG.debug("Flushed {} records to redis...", rows.size());
                    rows.clear();
                }
            } finally {
                forceFlush = false;
            }
        }
    }
The stop watch to measure time duration.
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/redis/src/main/java/org/apache/inlong/sort/redis/sink/AbstractRedisSinkFunction.java