Reddit » Scala
0 FOLLOWERS
Reddit is a network of communities based on people's interests. Find communities you're interested in, and become part of an online community! Get the latest articles and discussions on Scala by the Reddit community.
Reddit » Scala
40m ago
Specific question here for tracing in Scala
EDIT: Specifically not so interested in distributed tracing, that's fairly clear how to achieve, but full-fledged-flamegraph-internal-to-the-app-flamegraph-tracing-via-instrumentation
In a CRUD webapp, let's say a client receives an http request with a trace header, calls some logic, spins out some new fibers/futures/what-ever and does a bunch of work off the back of this instigating thing that all should be traced.
If you want flamegraphs etc in the tracing visualisation tool of your choice to show where time gets spent for all subsequent calls (ja ..read more
Reddit » Scala
6d ago
I am upgrading a lot of Scala 2.13 services up to Scala 3, and have encountered some codebases where reflection was used in unit tests to examine all the subclasses of a trait.
For example, in 2.x the way to make enumerations was with a sealed trait and case object subclasses. We would often make a collection listing all types, similar to Java enum .values. In our unit tests we would want to make sure no subtypes were accidentally omitted from that collection, and we would use reflection for that.
```scala import scala.reflect.runtime.universe
val classType = universe.typeOf[Branding] val sub ..read more