This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.time.Duration; | |
| import java.util.List; | |
| import java.util.concurrent.CountDownLatch; | |
| import java.util.concurrent.atomic.AtomicBoolean; | |
| import java.util.concurrent.atomic.AtomicReference; | |
| import java.util.concurrent.locks.LockSupport; | |
| import java.util.stream.Collectors; | |
| import java.util.stream.IntStream; | |
| import org.junit.jupiter.api.Test; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.concurrent.atomic.AtomicInteger; | |
| import java.util.concurrent.locks.LockSupport; | |
| import org.jctools.queues.MessagePassingQueue; | |
| import org.jctools.queues.MpscCompoundQueue; | |
| public class JcToolsMpscCompoundQueueRelaxedOfferInfiniteLoop { | |
| public static final int PARALLELISM = 8; | |
| public static final int DRAIN_SLEEP_NANOS = 100000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.instana; | |
| import static org.junit.Assert.assertTrue; | |
| import java.time.Duration; | |
| import java.util.ArrayList; | |
| import java.util.concurrent.CountDownLatch; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Executors; | |
| import java.util.concurrent.TimeUnit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Post event with information about the currently playing track to instana | |
| set oldPlayingTrack to getCurrentlyPlayingTrack() | |
| repeat while true | |
| set currentlyPlayingTrack to getCurrentlyPlayingTrack() | |
| if currentlyPlayingTrack is not oldPlayingTrack then | |
| set curl_data to "{\\\"title\\\":\\\"Listening to Track\\\",\\\"text\\\":\\\"Currently playing " & currentlyPlayingTrack & "\\\",\\\"duration\\\":60,\\\"severity\\\":-1}" | |
| set curl_command to "curl -XPOST -d \"" & curl_data & "\" http://127.0.0.1:42699/com.instana.plugin.generic.event" | |
| -- display notification curl_command | |
| do shell script curl_command |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Executors; | |
| import java.util.concurrent.TimeUnit; | |
| import java.util.concurrent.atomic.AtomicLong; | |
| import java.util.concurrent.atomic.LongAccumulator; | |
| import org.junit.Before; | |
| import org.junit.Test; | |
| import reactor.core.publisher.Flux; | |
| import reactor.core.publisher.FluxEmitter; | |
| import reactor.core.publisher.WorkQueueProcessor; |