<commit_before>/**
 * A simple GELF client library with support for different transport mechanisms.
 * <p>
 *     Currently available transports are
 *     <ul>
 *         <li>UDP</li>
 *         <li>TCP</li>
 *     </ul>
 * </p>
 * <p>
 *     All default transport implementations use a queue (backed by a {@link java.util.concurrent.BlockingQueue})
 *     to send messages in a background thread to avoid blocking the calling thread until a message has
 *     been sent. That means that the {@link org.graylog2.gelfclient.transport.GelfTransport#send(GelfMessage)}
 *     and {@link org.graylog2.gelfclient.transport.GelfTransport#trySend(GelfMessage)} methods do not
 *     actually send the messages but add them to a queue where the background thread will pick them up.
 *     This is important to keep in mind when it comes to message delivery guarantees.
 * </p>
 */
package org.graylog2.gelfclient;<commit_msg>Add code example to package-info for org.graylog2.gelfclient<commit_after>/**
 * <p>
 *     A simple GELF client library with support for different transport mechanisms.
 * </p>
 * <p>
 *     Currently available transports are
 *     <ul>
 *         <li>UDP</li>
 *         <li>TCP</li>
 *     </ul>
 * </p>
 * <p>
 *     All default transport implementations use a queue (backed by a {@link java.util.concurrent.BlockingQueue})
 *     to send messages in a background thread to avoid blocking the calling thread until a message has
 *     been sent. That means that the {@link org.graylog2.gelfclient.transport.GelfTransport#send(GelfMessage)}
 *     and {@link org.graylog2.gelfclient.transport.GelfTransport#trySend(GelfMessage)} methods do not
 *     actually send the messages but add them to a queue where the background thread will pick them up.
 *     This is important to keep in mind when it comes to message delivery guarantees.
 * </p>
 * <p>
 *     <h1>Example</h1>
 * </p>
 * <pre><code>
 *    final GelfConfiguration config = new GelfConfiguration();
 *
 *    // Optional but recommended settings
 *    config.setHost("127.0.0.1");
 *    config.setPort(12201);
 *    config.setTransport(GelfTransports.TCP);
 *
 *    // Optional settings
 *    config.setConnectTimeout(5000);
 *    config.setReconnectDelay(1000);
 *    config.setTcpNoDelay(true);
 *    config.setQueueSize(512);
 *    config.setSendBufferSize(32768);
 *
 *    final GelfTransport transport = GelfTransports.create(config);
 *
 *    boolean blocking = false;
 *    for (int i = 0; i < 100; i++) {
 *        final GelfMessage message = new GelfMessageBuilder("This is message #" + i, "localhost")
 *              .level(GelfMessageLevel.INFORMATIONAL)
 *              .additionalField("_foo", "bar")
 *              .additionalField("_count", i)
 *              .build();
 *        if (blocking) {
 *            // Blocks until there is capacity in the queue
 *            transport.send(message);
 *        } else {
 *            // Returns false if there isn't enough room in the queue
 *            boolean enqueued = transport.trySend(message);
 *        }
 *    }
 * </code></pre>
 */
package org.graylog2.gelfclient;
{'fraction_non_alphanumeric': 0.11182313361102211, 'fraction_numerical': 0.01281640499839795, 'mean_word_length': 2.830674846625767, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3628970', 'n_tokens_mistral': 926, 'n_tokens_neox': 892, 'n_words': 287}