by shigemk2

当面は技術的なことしか書かない

ファイル名に日付のついたログをfluentdで追っかけたかった

github.com

application.log.2016-10-12みたいなやつを追っかけたかった。tail-ex使えばよかった。というか、既に本家に組み込まれているから、標準で使えた。基本的なところじゃんか。

<source>
  type tail_ex
  path /var/log/**.log,/var/log/by-date/%Y/messages.%m/%Y%m%d
  tag tail_ex.*.${hostname}
  format /^(?<message>.*)$/
  pos_file /var/tmp/fluentd.pos
  refresh_interval 1800
</source>

リリースをいち早く知りたい人生だった

SlackのRSSアプリと、GitHubのRSSフィードのコンボでいけます。

GitHubのRSSフィードは、だいたいこのような形式になっており、

https://github.com/{user}/{repo_name}/releases.atom

例としてはこんな感じ。 https://github.com/akka/akka/releases.atom

で、これを、SlackのRSSにポチポチ登録していく感じ。

f:id:shigemk2:20161010211956p:plain

通知する部屋は、public/privateは問わないけど、通知に少しばかしラグがあるように思える。数分くらいかな。

efcl.info

christina04.hatenablog.com

giter8を試したい

試した作品

github.com

activator new からのminimal-scalaのテンプレートに、akkaを追加したものをテンプレートとして作成しました。

giter8もろもろ

ドキュメント。インストール方法やテンプレートの書き方とかが書いてある。

Giter8 — Giter8

テンプレート。作り方はだいたいこのあたりを見て、なぞっていけば。

github.com

他の人の作り方。結構参考になると思う。

akiomik.hatenablog.jp

他の人のテンプレート。参考になりました。

github.com

memo Akkaのdispatcher その2

Dispatchers — Akka Documentation

kzky.hatenablog.com

Dispatchers | Akka.NET

Dispatchers are responsible for scheduling all code that run inside the ActorSystem. Dispatchers are one of the most important parts of Akka.NET, as they control the throughput and time share for each of the actors, giving each one a fair share of resources.

mailbox, threadpoolの紐付けとメッセージハンドリングのロジックを行うイメージ

Akkaのシステムの中でも最も重要なところ。

fire and forget

! means “fire-and-forget”, e.g. send a message asynchronously and return immediately. Also known as tell.

ドキュメントを読めばわかるかもですけど、メッセージを送ったらすぐにリターンする。もとはたぶん追尾ミサイルのfire and forgetで、ミサイルを発射したら、ミサイルを発射した方はミサイルの行方を知らなくても良くて、着弾点の関心事はミサイル自身が担うというアレ。

Actors — Akka Documentation

about elastic search cat api

JSON is great… for computers. Even if it’s pretty-printed, trying to find relationships in the data is tedious. Human eyes, especially when looking at an ssh terminal, need compact and aligned text. The cat API aims to meet this need. All the cat commands accept a query string parameter help to see all the headers and info they provide, and the /_cat command alone lists all the available commands.

APIのドキュメントなのにこんなにフランクでいいんですかね……

catは人間が読みやすい形(おもにJSON)に変換して返却してくれる系のAPI。なんでCATなのかは知らない。indiceはよく使います。

medium.com

www.elastic.co