New port: databases/go-carbon

go-carbon is a go implementation of the carbon component of the graphite
project. It has support for multiple cpu's and can achieve higher concurrency.

WWW: https://github.com/lomik/go-carbon

PR:		226732
Submitted by:	Andreas Andersson <a.andersson.thn@gmail.com>
This commit is contained in:
Kurt Jaeger 2018-03-19 20:22:29 +00:00
parent b80e953f45
commit 576190ca7b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=465028
9 changed files with 126 additions and 2 deletions

2
GIDs
View File

@ -170,7 +170,7 @@ sqlgrey:*:226:
_hfm:*:227:
osrm:*:228:
kismet:*:229:
# free: 230
carbon:*:230:
# free: 231
# free: 232
# free: 233

2
UIDs
View File

@ -175,7 +175,7 @@ sqlgrey:*:226:226::0:0:SQLgrey Owner:/nonexistent:/usr/sbin/nologin
_hfm:*:227:227::0:0:hfm daemon:/nonexistent:/usr/sbin/nologin
osrm:*:228:228::0:0:osrm:/nonexistent:/usr/sbin/nologin
# free: 229
# free: 230
carbon:*:230:230::0:0:osrm:/nonexistent:/usr/sbin/nologin
# free: 231
# free: 232
# free: 233

View File

@ -94,6 +94,7 @@
SUBDIR += gigabase
SUBDIR += gnats4
SUBDIR += gnatsweb4
SUBDIR += go-carbon
SUBDIR += gomdb
SUBDIR += gosqlite3
SUBDIR += gqlplus

View File

@ -0,0 +1,38 @@
# $FreeBSD$
PORTNAME= go-carbon
DISTVERSIONPREFIX= v
DISTVERSION= 0.12.0
CATEGORIES= databases
MAINTAINER= a.andersson.thn@gmail.com
COMMENT= Go implementation of carbon
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE.md
BUILD_DEPENDS= go>=1.8:lang/go
USES= go
USE_GITHUB= yes
GH_ACCOUNT= lomik
USE_RC_SUBR= ${PORTNAME}
USERS= carbon
GROUPS= carbon
do-build:
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC}/_vendor \
go build --ldflags '-X main.BuildVersion=${DISTVERSION}' github.com/lomik/go-carbon
do-install:
@${MKDIR} ${STAGEDIR}/var/db/go-carbon
@${MKDIR} ${STAGEDIR}/var/log/go-carbon
@${MKDIR} ${STAGEDIR}/${PREFIX}/etc/go-carbon
${INSTALL_PROGRAM} ${WRKSRC}/go-carbon ${STAGEDIR}${PREFIX}/bin/
${INSTALL} ${WRKSRC}/deploy/go-carbon.conf ${STAGEDIR}${PREFIX}/etc/go-carbon/
${INSTALL} ${WRKSRC}/deploy/storage-aggregation.conf ${STAGEDIR}${PREFIX}/etc/go-carbon/
${INSTALL} ${WRKSRC}/deploy/storage-schemas.conf ${STAGEDIR}${PREFIX}/etc/go-carbon/
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1521477973
SHA256 (lomik-go-carbon-v0.12.0_GH0.tar.gz) = 2661492a9b0209977548ef86340f606e29630ab9d5d971bdf745d4b30495875c
SIZE (lomik-go-carbon-v0.12.0_GH0.tar.gz) = 3035132

View File

@ -0,0 +1,55 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: go-carbon
# REQUIRE: LOGIN
# BEFORE: securelevel
# KEYWORD: shutdown
# Add the following line to /etc/rc.conf to enable `go-carbon':
#
# go_carbon_enable="YES"
#
# optional:
#
# go_carbon_conf (flags): Set extra flags here. More options in go-carbon(1)
# Default is empty "".
# go_carbon_user (user): Set user to run go-carbon.
# Default is "carbon".
. /etc/rc.subr
name="go-carbon"
rcvar="go_carbon_enable"
: ${go_carbon_enable:="NO"}
: ${go_carbon_user:="carbon"}
: ${go_carbon_config:="/usr/local/etc/go-carbon/go-carbon.conf"}
start_cmd="go_carbon_start"
stop_cmd="go_carbon_stop"
status_cmd="go_carbon_status"
procname="/usr/local/bin/go-carbon"
pidfile="/var/run/$name.pid"
# read configuration and set defaults
load_rc_config "$name"
go_carbon_start()
{
${procname} -config ${go_carbon_config} -daemon -pidfile ${pidfile}
}
go_carbon_stop()
{
kill -TERM `cat /var/run/go-carbon.pid`
}
go_carbon_status()
{
echo "go-carbon is running as pid" `cat /var/run/go-carbon.pid`
}
run_rc_command "$1"

View File

@ -0,0 +1,17 @@
--- deploy/go-carbon.conf.orig 2018-03-19 13:53:13 UTC
+++ deploy/go-carbon.conf
@@ -11,11 +11,11 @@ metric-interval = "1m0s"
max-cpu = 4
[whisper]
-data-dir = "/var/lib/graphite/whisper"
+data-dir = "/var/db/go-carbon/whisper"
# http://graphite.readthedocs.org/en/latest/config-carbon.html#storage-schemas-conf. Required
-schemas-file = "/etc/go-carbon/storage-schemas.conf"
+schemas-file = "/usr/local/etc/go-carbon/storage-schemas.conf"
# http://graphite.readthedocs.org/en/latest/config-carbon.html#storage-aggregation-conf. Optional
-aggregation-file = "/etc/go-carbon/storage-aggregation.conf"
+aggregation-file = "/usr/local/etc/go-carbon/storage-aggregation.conf"
# Worker threads count. Metrics sharded by "crc32(metricName) % workers"
workers = 8
# Limits the number of whisper update_many() calls per second. 0 - no limit

View File

@ -0,0 +1,4 @@
go-carbon is a go implementation of the carbon component of the graphite
project. It has support for multiple cpu's and can achieve higher concurrency.
WWW: https://github.com/lomik/go-carbon

View File

@ -0,0 +1,6 @@
bin/%%GO_PKGNAME%%
%%ETCDIR%%/%%GO_PKGNAME%%.conf
%%ETCDIR%%/storage-aggregation.conf
%%ETCDIR%%/storage-schemas.conf
@dir(carbon,carbon,0750) /var/db/%%GO_PKGNAME%%
@dir(carbon,carbon,0750) /var/log/%%GO_PKGNAME%%