Skip to content

Commit

Permalink
Merge pull request #82 from permutive-engineering/website
Browse files Browse the repository at this point in the history
Revamp website
  • Loading branch information
alejandrohdezma authored Aug 29, 2024
2 parents ad3577b + c6f31aa commit 0e0f85c
Show file tree
Hide file tree
Showing 57 changed files with 8,884 additions and 492 deletions.
14 changes: 11 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,26 @@ ThisBuild / organization := "com.permutive"
ThisBuild / versionPolicyIntention := Compatibility.None

addCommandAlias("ci-test", "fix --check; versionPolicyCheck; mdoc; publishLocal; +test")
addCommandAlias("ci-docs", "github; mdoc; headerCreateAll")
addCommandAlias("ci-docs", "github; mdoc; headerCreateAll; docusaurusPublishGhpages")
addCommandAlias("ci-publish", "versionCheck; github; ci-release")

lazy val documentation = project
.enablePlugins(MdocPlugin)

lazy val website = project
.settings(libraryDependencies ++= Dependencies.website)
.dependsOn(prometheus4cats, `prometheus4cats-java`, `prometheus4cats-testing`)
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.settings(mdocIn := baseDirectory.value / "docs")
.settings(mdocOut := (Compile / target).value / "mdoc")
.settings(watchTriggers += mdocIn.value.toGlob / "*.md")

lazy val prometheus4cats = module
.settings(libraryDependencies ++= Dependencies.prometheus4cats)
.settings(libraryDependencies ++= scalaVersion.value.on(2)("org.scala-lang" % "scala-reflect" % scalaVersion.value))
.settings(libraryDependencies ++= scalaVersion.value.on(2)(Dependencies.shapeless))
.settings(libraryDependencies ++= scalaVersion.value.on(2)(Dependencies.`kind-projector`))
.settings(scalacOptions += "-Wconf:cat=unused-nowarn:s")
.settings(scalacOptions ++= scalaVersion.value.on(3)("-Ykind-projector"))
.settings(scalacOptions ++= scalaVersion.value.on(2)("-Wconf:cat=unused-nowarn:s"))

lazy val `prometheus4cats-testkit` = module
.settings(libraryDependencies ++= Dependencies.`prometheus4cats-testkit`)
Expand All @@ -25,6 +32,7 @@ lazy val `prometheus4cats-testkit` = module
lazy val `prometheus4cats-testing` = module
.settings(libraryDependencies ++= Dependencies.`prometheus4cats-testing`)
.dependsOn(prometheus4cats)
.settings(scalacOptions ++= scalaVersion.value.on(2)("-Wconf:cat=unused-nowarn:s"))

lazy val `prometheus4cats-java` = module
.settings(libraryDependencies ++= Dependencies.`prometheus4cats-java`)
Expand Down
119 changes: 0 additions & 119 deletions modules/docs/css/permutive.css

This file was deleted.

108 changes: 0 additions & 108 deletions modules/docs/default.template.html

This file was deleted.

Binary file removed modules/docs/img/icon-150x150.png
Binary file not shown.
Binary file removed modules/docs/img/icon-300x300.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -788,52 +788,6 @@ object JavaMetricRegistry {

}

/** Create a metric registry using the default `io.prometheus.client.CollectorRegistry`
*
* Note that this registry implementation introduces a runtime constraint that requires each metric must have a
* unique name, even if the label names are different. See this issue for more details
* https://github.com/prometheus/client_java/issues/696.
*
* @param callbackTimeout
* How long all callbacks for a certain metric name should be allowed to take before timing out. This is **per
* metric name**.
* @param callbackCollectionTimeout
* how long the combined set of callbacks for a metric or metric collection should take to time out. This is for
* **all callbacks for a metric** or **all callbacks returning a metric collection**.
*/
@deprecated("Use JavaMetricRegistry.Builder instead", "2.0.0")
def default[F[_]: Async: Logger](
callbackTimeout: FiniteDuration = 250.millis,
callbackCollectionTimeout: FiniteDuration = 1.second
): Resource[F, JavaMetricRegistry[F]] =
Builder().withCallbackTimeout(callbackTimeout).withCallbackCollectionTimeout(callbackCollectionTimeout).build[F]

/** Create a metric registry using the given `io.prometheus.client.CollectorRegistry`
*
* Note that this registry implementation introduces a runtime constraint that requires each metric must have a
* unique name, even if the label names are different. See this issue for more details
* https://github.com/prometheus/client_java/issues/696.
*
* @param promRegistry
* the `io.prometheus.client.CollectorRegistry` to use
* @param callbackTimeout
* How long all callbacks for a certain metric name should be allowed to take before timing out. This is **per
* metric name**.
* @param callbackCollectionTimeout
* how long the combined set of callbacks for a metric or metric collection should take to time out. This is for
* **all callbacks for a metric** or **all callbacks returning a metric collection**.
*/
@deprecated("Use JavaMetricRegistry.Builder instead", "2.0.0")
def fromSimpleClientRegistry[F[_]: Async: Logger](
promRegistry: CollectorRegistry,
callbackTimeout: FiniteDuration = 250.millis,
callbackCollectionTimeout: FiniteDuration = 1.second
): Resource[F, JavaMetricRegistry[F]] = Builder()
.withRegistry(promRegistry)
.withCallbackTimeout(callbackTimeout)
.withCallbackCollectionTimeout(callbackCollectionTimeout)
.build[F]

private def makeCallbacksGauge[F[_]: Monad](dis: Dispatcher[F], state: Ref[F, CallbackState[F]]) = new Collector {

override def collect(): util.List[MetricFamilySamples] = dis.unsafeRunSync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class TestingMetricRegistrySuite extends CatsEffectSuite {
}

test("Error if registering same name and labels but different type") {
val Right(labels) = Metric.CommonLabels.of(Label.Name("one") -> "one", Label.Name("two") -> "two")
val labels = Metric.CommonLabels.of(Label.Name("one") -> "one", Label.Name("two") -> "two").toOption.get
List.range(0, 100).traverse { _ =>
TestingMetricRegistry[IO].flatMap { reg =>
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package prometheus4cats.internal

import prometheus4cats._

import scala.quoted.*

import prometheus4cats.*

private[prometheus4cats] trait CounterNameFromStringLiteral {

inline def apply(inline t: String): Counter.Name = ${
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package prometheus4cats.internal

import prometheus4cats._

import scala.quoted.*

import prometheus4cats.*

private[prometheus4cats] trait ExemplarLabelNameFromStringLiteral {

inline def apply(inline t: String): Exemplar.LabelName = ${
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package prometheus4cats.internal

import prometheus4cats._

import scala.quoted.*

import prometheus4cats.*

private[prometheus4cats] trait GaugeNameFromStringLiteral {

inline def apply(inline t: String): Gauge.Name = ${
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package prometheus4cats.internal

import prometheus4cats._

import scala.quoted.*

import prometheus4cats.*

private[prometheus4cats] trait HistogramNameFromStringLiteral {

inline def apply(inline t: String): Histogram.Name = ${
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package prometheus4cats.internal

import prometheus4cats._

import scala.quoted.*

import prometheus4cats.*

private[prometheus4cats] trait InfoNameFromStringLiteral {

inline def apply(inline t: String): Info.Name = ${
Expand Down
Loading

0 comments on commit 0e0f85c

Please sign in to comment.