-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189 from fsanaulla/release-0.6.0
[RELEASE][0.6.0] - simplifying AHC backend
- Loading branch information
Showing
32 changed files
with
435 additions
and
340 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Including issues: | ||
- fsanaulla/chronicler#178 Moving away from sttp to pure AHC backend | ||
|
||
Contributors: | ||
- @fsanaulla |
16 changes: 7 additions & 9 deletions
16
examples/udp/src/main/scala/com.github.fsanaulla.chronicler.example.udp/Main.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
package com.github.fsanaulla.chronicler.example.udp | ||
|
||
import com.github.fsanaulla.chronicler.core.model.{InfluxFormatter, Point} | ||
import com.github.fsanaulla.chronicler.macros.Influx | ||
import com.github.fsanaulla.chronicler.macros.annotations.{field, tag} | ||
import com.github.fsanaulla.chronicler.macros.auto._ | ||
import com.github.fsanaulla.chronicler.udp.InfluxUdp | ||
|
||
import scala.util.Try | ||
|
||
object Main { | ||
|
||
def main(args: Array[String]): Unit = { | ||
final case class Test(@tag name: String, @field age: Int) | ||
|
||
// generate formatter at compile-time | ||
implicit val fmt: InfluxFormatter[Test] = Influx.formatter[Test] | ||
|
||
val t = Test("f", 1) | ||
val host = args.headOption.getOrElse("localhost") | ||
val t = Test("f", 1) | ||
val host = args.headOption.getOrElse("localhost") | ||
val influx = InfluxUdp(host) | ||
|
||
for { | ||
// write record to Influx | ||
_ <- influx.write("cpu", t) | ||
// close client | ||
_ <- influx.close() | ||
_ <- Try(influx.close()) | ||
} yield println("Stored!") | ||
} | ||
} |
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
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
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
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
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
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
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
Oops, something went wrong.