Skip to content

Instantly share code, notes, and snippets.

openapi: 3.0.3
info:
title: PAPI - Filtering
version: 0.1.0
paths:
/users_deep_object:
get:
parameters:
- in: query
name: age
[
{"id":0,"name":"0,6556176","ph":"X","ts":1613119800605000,"dur":138000,"pid":"deployment-fdb4b6df5-nv7nl","tid":"Partition 0"},
{"id":1,"name":"2,6555800","ph":"X","ts":1613119801222000,"dur":230000,"pid":"deployment-fdb4b6df5-l8qc9","tid":"Partition 2"},
{"id":2,"name":"1,6555232","ph":"X","ts":1613119802723000,"dur":148000,"pid":"deployment-fdb4b6df5-l8qc9","tid":"Partition 1"},
{"id":3,"name":"3,6554120","ph":"X","ts":1613119802985000,"dur":152000,"pid":"deployment-fdb4b6df5-n7495","tid":"Partition 3"},
{"id":4,"name":"1,6555233","ph":"X","ts":1613119803794000,"dur":129000,"pid":"deployment-fdb4b6df5-l8qc9","tid":"Partition 1"},
{"id":5,"name":"2,6555801","ph":"X","ts":1613119804128000,"dur":139000,"pid":"deployment-fdb4b6df5-l8qc9","tid":"Partition 2"},
{"id":6,"name":"2,6555802","ph":"X","ts":1613119805433000,"dur":212000,"pid":"deployment-fdb4b6df5-l8qc9","tid":"Partition 2"},
{"id":7,"name":"0,6556177","ph":"X","ts":1613119805572000,"dur":146000,"pid":"deployment-fdb4b6df5-nv7nl","tid":"Partition 0"}
(import com.codahale.metrics.MetricRegistry)
(import com.codahale.metrics.ConsoleReporter)
(def registry (MetricRegistry.))
(def meter (.meter registry "some_meter"))
(def counter (.counter registry "some_counter"))
(def timer (.timer registry "some_timer"))
(.inc counter)
(.inc counter)
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library", "scala_binary")
scala_library(
name = "sjsir",
srcs = ["Test.scala"],
deps = ["@scalajs//:library"],
data = ["@scalajs//:compiler"],
scalacopts = ["-Xplugin:external/scalajs/lib/scalajs-compiler_2.11.11-0.6.19.jar"],
#scalacopts = ["-Xplugin:$(location @scalajs//:compiler)"], ??? location doesn't seems to be working
)
, {
label: "Nakdi unconsumed events",
graphStyle: "stacked",
plots: [
{
facet: "unconsumed_events_0",
filter: "$serverHost='cats-nua' $logfile='/var/log/scalyr-agent-2/containers/influx.log'",
label: "0"
}, {
facet: "unconsumed_events_1",
class CustomStage extends GraphStage[FlowShape[ByteString, ByteString]] {
val in = Inlet[ByteString]("CustomStage.in")
val out = Outlet[ByteString]("CustomStage.out")
override val shape = FlowShape.of(in, out)
override def createLogic(inheritedAttributes: Attributes): GraphStageLogic = new GraphStageLogic(shape) with InHandler with OutHandler {
setHandlers(in, out, this)
import java.security.cert.X509Certificate
import javax.net.ssl.{KeyManager, SSLContext, X509TrustManager}
import akka.http.scaladsl.ConnectionContext
object NoSSL {
def apply() = {
object NoCheckX509TrustManager extends X509TrustManager {
override def checkClientTrusted(chain: Array[X509Certificate], authType: String) = ()
package consumer
import akka.actor._
import akka.kafka.ConsumerMessage._
import akka.kafka._
import akka.kafka.scaladsl._
import akka.stream._
import akka.stream.scaladsl._
import akka.testkit._
import net.manub.embeddedkafka._
@muller
muller / README.md
Last active September 9, 2016 15:13
values vs external interaction

Values vs External interactions

If I was to define the dependency arrow in UML 3.0 I would draw it in red with a pitchfork. It is evil.

External dependencies like databases or webservices will slow down your team. The development environment will get complex with installations, configurations and debugging.

Mocking isn't the only answer. Working with values only, allow you to implement a slice of your application in isolation.

Dependencies and rules

from subprocess import call
PATH_TO_EXECUTABLE = "/path/to/executable"
def execute():
call([PATH_TO_EXECUTABLE])