-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 95974fc
Showing
184 changed files
with
41,941 additions
and
0 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 @@ | ||
.git |
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 @@ | ||
/nasne_exporter |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,42 @@ | ||
# Gopkg.toml example | ||
# | ||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md | ||
# for detailed Gopkg.toml documentation. | ||
# | ||
# required = ["github.com/user/thing/cmd/thing"] | ||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project" | ||
# version = "1.0.0" | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project2" | ||
# branch = "dev" | ||
# source = "github.com/myfork/project2" | ||
# | ||
# [[override]] | ||
# name = "github.com/x/y" | ||
# version = "2.4.0" | ||
# | ||
# [prune] | ||
# non-go = false | ||
# go-tests = true | ||
# unused-packages = true | ||
|
||
|
||
[[constraint]] | ||
branch = "master" | ||
name = "github.com/golang/glog" | ||
|
||
[[constraint]] | ||
name = "github.com/prometheus/client_golang" | ||
version = "0.8.0" | ||
|
||
[[constraint]] | ||
name = "github.com/spf13/cobra" | ||
version = "0.0.1" | ||
|
||
[prune] | ||
go-tests = true | ||
unused-packages = true |
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,8 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright © 2018 Takahiro Hatori | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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,16 @@ | ||
PACKAGE_NAME=github.com/hatotaka/nasne_exporter | ||
CONTAINER_NAME=quay.io/hatotaka/nasne_exporter | ||
BIN_NAME=nasne_exporter | ||
|
||
|
||
.PHONY: build-local build-container clean | ||
build-local: | ||
go build -o ${BIN_NAME} $(PACKAGE_NAME)/cmd/nasne_exporter | ||
|
||
build-container: | ||
docker build \ | ||
-t $(CONTAINER_NAME):local \ | ||
-f build/package/Dockerfile.amd64 \ | ||
. | ||
clean: | ||
rm -rf ${BIN_NAME} |
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,41 @@ | ||
# Nasne exporter | ||
[](https://quay.io/repository/hatotaka/nasne_exporter) | ||
|
||
[nasne](https://www.jp.playstation.com/nasne/) 用 Prometheus exporterです。 | ||
|
||
## メトリクス | ||
|
||
| メトリクス名 | メトリクスタイプ | ラベル | 説明 | | ||
| --- | --- | --- | --- | | ||
| `nasne_info` | Gauge | `hardware_version` `name` `product_name` `software_version` | nasne 情報 | | ||
| `nasne_hdd_size_bytes` | Gauge | `format` `id` `name` `product_id` `vendor_id` | ハードディスクの容量 | | ||
| `nasne_hdd_usage_bytes` | Gauge | `format` `id` `name` `product_id` `vendor_id` | ハードディスクの使用容量 | | ||
| `nasne_dtcpip_clients` | Gauge | `name` | 接続されているDTCP-IPのクライアント数 | | ||
| `nasne_recordings` | Gauge | `name` | 録画中の件数 | | ||
| `nasne_recorded_titles` | Gauge | `name` | 録画されている件数 | | ||
| `nasne_reserved_titles` | Gauge | `name` | 予約されている件数 | | ||
| `nasne_reserved_conflict_titles` | Gauge | `name` | コンフリクトした録画件数 | | ||
| `nasne_reserved_notfound_titles` | Gauge | `name` | 見つからない録画件数 | | ||
| `nasne_last_collect_time` | Gauge | | 最後にメトリクスを収集した時間 | | ||
| `nasne_collect_duration_seconds` | Histogram | `name` | メトリクス収集にかかった時間 | | ||
|
||
## ビルドと実行 | ||
|
||
以下のソフトウェアに依存しています。 | ||
|
||
- [Go compiler](https://golang.org/dl/) | ||
|
||
以下の手順でビルドできます。 | ||
|
||
``` | ||
go get github.com/hatotaka/nasne_exporter | ||
cd ${GOPATH-$HOME/go}/src/github.com/hatotaka/nasne_exporter | ||
make | ||
./nasne_exporter <flags> | ||
``` | ||
|
||
フラグは以下の方法で確認できます。 | ||
|
||
``` | ||
./nasne_exporter -h | ||
``` |
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,21 @@ | ||
## Build | ||
FROM golang:1.11 AS build | ||
|
||
ENV workdir /go/src/github.com/hatotaka/nasne_exporter | ||
ENV CGO_ENABLED 0 | ||
ENV GOARCH amd64 | ||
|
||
ADD . ${workdir} | ||
WORKDIR ${workdir} | ||
|
||
RUN go build \ | ||
-o /tmp/nasne_exporter \ | ||
github.com/hatotaka/nasne_exporter/cmd/nasne_exporter | ||
|
||
## Run | ||
FROM scratch | ||
|
||
EXPOSE 8080 | ||
COPY --from=build /tmp/nasne_exporter /opt/bin/ | ||
|
||
ENTRYPOINT ["/opt/bin/nasne_exporter"] |
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,21 @@ | ||
## Build | ||
FROM golang:1.11 AS build | ||
|
||
ENV workdir /go/src/github.com/hatotaka/nasne_exporter | ||
ENV CGO_ENABLED 0 | ||
ENV GOARCH arm | ||
|
||
ADD . ${workdir} | ||
WORKDIR ${workdir} | ||
|
||
RUN go build \ | ||
-o /tmp/nasne_exporter \ | ||
github.com/hatotaka/nasne_exporter/cmd/nasne_exporter | ||
|
||
## Run | ||
FROM scratch | ||
|
||
EXPOSE 8080 | ||
COPY --from=build /tmp/nasne_exporter /opt/bin/ | ||
|
||
ENTRYPOINT ["/opt/bin/nasne_exporter"] |
Oops, something went wrong.