> cassandra-stress mixed ratio\(write=1,read=3\) n=1000000 cl=QUORUM \
-pop dist=UNIFORM\(1..1000000\) \
-mode native cql3 \
-rate threads=50 \
-node test-cassandra21.market.local,test-cassandra22.market.local,test-cassandra23.market.local
This file contains 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 cats.data.EitherT | |
import cats.effect.Timer | |
import cats.implicits._ | |
import cats.{ApplicativeError, Foldable, Functor, Monad, MonadError} | |
import scala.concurrent.duration.FiniteDuration | |
trait Observable[F[_], A] { outer => | |
def subscribe[O](observer: Observer[F, A, O]): F[O] | |
final def foldLeft[O](o: O)(f: (O, A) => O)( |
This file contains 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 | |
import java.util.{Collections, UUID} | |
import cats.effect.{Async, Timer} | |
import io.evotor.webhooks.common.Committable | |
import fs2._ | |
import org.apache.kafka.clients.consumer._ | |
import org.apache.kafka.common.TopicPartition | |
import org.apache.kafka.common.serialization.Deserializer | |
import scala.concurrent.blocking |
This file contains 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
// Tired of subtyping and `extends Product with Serializable`? | |
// It is impossible to instantiate a concrete subtype of `Root` | |
// It preserves pattern matching exhaustiveness check | |
sealed abstract class Root | |
object Root { | |
private final case class LeafInt(i: Int) extends Root | |
object LeafInt { def apply(i: Int): Root = new LeafInt(i) } | |
private final case class LeafString(s: String) extends Root | |
object LeafString { def apply(s: String): Root = new LeafString(s) } |
This file contains 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
#!/bin/bash | |
app=$1 | |
chosen_one=$(kubectl get pods -l app=$app | tail -1 | awk '{print $1}') | |
echo "Keeping alive $chosen_one" | |
while true; do | |
pods=$(kubectl get pods -l app=$app | tail -n +2 | awk '{print $1}') | |
for pod in $pods; do |
This file contains 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
#!/bin/bash | |
working_dir="$( cd "$1" && pwd )" | |
chart_name=$(basename $(pwd)) | |
unamestr=$(uname) | |
if [[ "$unamestr" == 'Darwin' ]]; then | |
sha='shasum' | |
elif [[ "$unamestr" == 'Linux' ]]; then | |
sha='sha1sum' |
This file contains 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.evotor.payments.common | |
import aecor.data.Folded | |
import cats.MonadError | |
import cats.implicits._ | |
object Projection { | |
def apply[F[_], I, E, S]( | |
store: Store[F, I, Versioned[S]] | |
)(implicit F: MonadError[F, Throwable], SE: Eventsourced[S, E]): (I, Long, E) => F[Unit] = { |
This file contains 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.http.scaladsl.server.Directives._ | |
import akka.cluster.Member | |
import akka.actor.Address | |
import akka.http.scaladsl.model.StatusCodes | |
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport._ | |
import io.circe.generic.auto._ | |
val cluster = Cluster(system) | |
final case class ClusterView(status: MemberStatus, |
This file contains 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 io.prometheus.client.CollectorRegistry | |
import io.prometheus.client.dropwizard.DropwizardExports | |
import io.prometheus.client.hotspot.DefaultExports | |
import nl.grons.metrics.scala.DefaultInstrumented | |
import akka.actor.ActorSystem | |
import akka.stream.ActorMaterializer | |
import akka.http.scaladsl.Http | |
object App extends App with DefaultInstrumented { | |
This file contains 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
Drift into Failure - http://www.amazon.com/Drift-into-Failure-Components-Understanding-ebook/dp/B009KOKXKY | |
How Complex Systems Fail - http://web.mit.edu/2.75/resources/random/How%20Complex%20Systems%20Fail.pdf | |
Leverage Points: Places to Intervene in a System - http://www.donellameadows.org/archives/leverage-points-places-to-intervene-in-a-system/ | |
Going Solid: A Model of System Dynamics and Consequences for Patient Safety - http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1743994/ | |
Resilience in Complex Adaptive Systems: Operating at the Edge of Failure - https://www.youtube.com/watch?v=PGLYEDpNu60 | |
Puppies! Now that I’ve got your attention, Complexity Theory - https://www.ted.com/talks/ nicolas_perony_puppies_now_that_i_ve_got_your_attention_complexity_theory | |
How Bacteria Becomes Resistant - http://www.abc.net.au/science/slab/antibiotics/resistance.htm | |
Towards Resilient Architectures: Biology Lessons - http://www.metropolismag.com/Point-of-View/March-2013/Toward-Resilient-Architectures-1-Biology-Lessons/ Dealing in |