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 kamon.netty.playground.http.helloworld | |
import io.netty.bootstrap.ServerBootstrap | |
import io.netty.channel.ChannelOption | |
import io.netty.channel.nio.NioEventLoopGroup | |
import io.netty.channel.socket.nio.NioServerSocketChannel | |
import io.netty.util.internal.logging.{InternalLoggerFactory, Slf4JLoggerFactory} | |
import kamon.Kamon | |
import kamon.netty.annotation.MetricName | |
import kamon.netty.playground.HttpHelloWorldServerInitializer |
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
/* ========================================================================================= | |
* Copyright © 2013-2014 the kamon project <http://kamon.io/> | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | |
* except in compliance with the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software distributed under the | |
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, |
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
TraceLocalKey<String> stringKey = TraceLocal.newTraceLocalKey(); | |
TraceLocal.store(stringKey, "Pepe"); | |
Option<String> retrieve = TraceLocal.retrieve(stringKey); //option | |
String retrieve = TraceLocal.get(stringKey); | |
System.out.println(retrieve); |
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
object TraceLocal { | |
trait TraceLocalKey[T] | |
trait AvailableToMdc extends TraceLocalKey[String] { | |
def mdcKey: String | |
} | |
object AvailableToMdc { | |
case class DefaultKeyAvailableToMdc(mdcKey: String) extends AvailableToMdc |
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.function.Consumer; | |
import static java.lang.System.out; | |
class JavaResource { | |
private JavaResource() {out.println("created...");} | |
public void operation1() {out.println("operation 1");} | |
public void operation2() {out.println("operation 2");} | |
private void close() { out.println("cleanup");} | |
public static void use(Consumer<JavaResource> block) { |
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
#!/usr/bin/env python | |
import argparse | |
import sys | |
from clint.textui import progress | |
from clint.textui import colored | |
from kazoo.client import KazooClient, KazooState | |
NewerOlder