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
/** | |
* AS IT WAS WITH OPENTRACING | |
* Utilities to transform headers of a Durable Queue message into | |
* Open Tracing span contexts and vice-versa. | |
*/ | |
object Propagation { | |
/** | |
* Return a span context from headers and a tracer. | |
*/ |
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
val storageLoader = storage | |
.load(LatestDashboardsEvents.Codec( | |
principal.getSecret(DashboardsEvents.EventsKey)), | |
latestDashboardsEventsId) | |
.map { maybeSnapshot => | |
maybeSnapshot.getOrElse(LatestDashboardsEvents(List.empty, None)) | |
} | |
def tailFromOffset( | |
offset: Option[Long], |
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
use std::env; | |
use std::fs::File; | |
use std::io::{BufRead, BufReader}; | |
use std::os::raw::c_double; | |
use chrono::{Duration, NaiveDateTime}; | |
struct State { | |
x0: Option<(NaiveDateTime, c_double)>, | |
x1: Option<(NaiveDateTime, c_double)>, |
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 2018 Titan Class Pty Ltd | |
* | |
* 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 |
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
sealed abstract class Event(val id: Int) | |
final case class CountersUpdated(override val id: Int, | |
counter: Option[Int]) | |
extends Event(id) | |
final case class DeviceIdUpdated(override val id: Int, deviceId: Int) extends Event(id) |
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
private val tracerConfig = new Configuration( | |
config.getString("lora-server.jaeger.service-name"), | |
if (config.getBoolean("lora-server.jaeger.constant-sampling")) | |
new SamplerConfiguration("const", 1) | |
else new SamplerConfiguration(), | |
new ReporterConfiguration( | |
true, // logSpans | |
config.getString("lora-server.jaeger.agent-host"), | |
config.getInt("lora-server.jaeger.agent-port"), | |
config.getDuration("lora-server.jaeger.flush-interval").toMillis.toInt, |
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 akka.NotUsed | |
import akka.stream.scaladsl.Flow | |
case object NotZero | |
// Emits either an Int when zero, or a domain object indicating | |
// that the Int is non zero. Use this approach instead of relying | |
// on exceptions. Exceptions are for exceptional conditions, | |
// largely unanticipated, and they will terminate a stream. | |
val flow: Flow[Int, Either[NotZero.type, Int], NotUsed] = |
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
val (recycleQueue, recycleSource) = | |
Source | |
.queue[SoilStateReading](100, OverflowStrategy.dropTail) | |
.prefixAndTail(0) | |
.map(_._2) | |
.toMat(Sink.head)(Keep.both) | |
.run() | |
StreamConverters.fromInputStream(() => this.getClass.getClassLoader.getResourceAsStream("sensors.log")) | |
.via(SoilStateReading.csvParser) | |
.merge(Source.fromFutureSource(recycleSource)) |
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
### Keybase proof | |
I hereby claim: | |
* I am huntc on github. | |
* I am huntc (https://keybase.io/huntc) on keybase. | |
* I have a public key ASAK5MC9gaWxTBKWnZcUlTofK-51TIDi2R-UDtMGGUh_7Ao | |
To claim this, I am signing this object: |
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
MESOS_AGENT_ENDPOINT=10.0.1.187:5051 | |
MESOS_CHECKPOINT=0 | |
MESOS_DIRECTORY=/tmp/mesos/slaves/e23ea3f5-0c2c-4220-8352-ec387538170f-S0/frameworks/e23ea3f5-0c2c-4220-8352-ec387538170f-0008/executors/conductr.node.christophersmbp.lan.executor/runs/3e175322-d045-41dc-975e-1f4394bffe68 | |
MESOS_EXECUTOR_ID=conductr.node.christophersmbp.lan.executor | |
MESOS_EXECUTOR_SHUTDOWN_GRACE_PERIOD=5secs | |
MESOS_FRAMEWORK_ID=e23ea3f5-0c2c-4220-8352-ec387538170f-0008 | |
MESOS_NATIVE_JAVA_LIBRARY=/usr/local/Cellar/mesos/0.28.1/lib/libmesos-0.28.1.dylib | |
MESOS_NATIVE_LIBRARY=/usr/local/Cellar/mesos/0.28.1/lib/libmesos-0.28.1.dylib | |
MESOS_SANDBOX=/tmp/mesos/slaves/e23ea3f5-0c2c-4220-8352-ec387538170f-S0/frameworks/e23ea3f5-0c2c-4220-8352-ec387538170f-0008/executors/conductr.node.christophersmbp.lan.executor/runs/3e175322-d045-41dc-975e-1f4394bffe68 | |
MESOS_SLAVE_ID=e23ea3f5-0c2c-4220-8352-ec387538170f-S0 |