aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authorswills <swills@FreeBSD.org>2013-12-23 00:25:58 +0800
committerswills <swills@FreeBSD.org>2013-12-23 00:25:58 +0800
commit3f88b6f8d7890324a824ed530bceed5b40321476 (patch)
tree2badf9d97cb01d55634ecf2a8c484d06d3d627db /net-mgmt
parent781207305a184992973571cbbabf7aaf551cdc81 (diff)
downloadfreebsd-ports-gnome-3f88b6f8d7890324a824ed530bceed5b40321476.tar.gz
freebsd-ports-gnome-3f88b6f8d7890324a824ed530bceed5b40321476.tar.zst
freebsd-ports-gnome-3f88b6f8d7890324a824ed530bceed5b40321476.zip
A network daemon that runs on the Node.js platform and listens for statistics,
like counters and timers, sent over UDP and sends aggregates to one or more pluggable backend services (e.g., Graphite). WWW: https://github.com/etsy/statsd PR: ports/171855 Submitted by: kimor79@yahoo.com
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/Makefile1
-rw-r--r--net-mgmt/statsd/Makefile40
-rw-r--r--net-mgmt/statsd/distinfo2
-rw-r--r--net-mgmt/statsd/files/statsd.in40
-rw-r--r--net-mgmt/statsd/pkg-descr5
-rw-r--r--net-mgmt/statsd/pkg-plist19
6 files changed, 107 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile
index ab5fb0e2de5b..60bc8cf0d80a 100644
--- a/net-mgmt/Makefile
+++ b/net-mgmt/Makefile
@@ -307,6 +307,7 @@
SUBDIR += softflowd
SUBDIR += spectools
SUBDIR += ssgless
+ SUBDIR += statsd
SUBDIR += subcalc
SUBDIR += sysmon
SUBDIR += tcpreplay
diff --git a/net-mgmt/statsd/Makefile b/net-mgmt/statsd/Makefile
new file mode 100644
index 000000000000..14d5a69c5135
--- /dev/null
+++ b/net-mgmt/statsd/Makefile
@@ -0,0 +1,40 @@
+# $FreeBSD$
+
+PORTNAME= statsd
+PORTVERSION= 0.7.0
+CATEGORIES= net-mgmt
+MASTER_SITES= https://github.com/etsy/${PORTNAME}/archive/v${PORTVERSION}.tar.gz?dummy=/
+
+MAINTAINER= kimor79@yahoo.com
+COMMENT= Simple daemon for easy stats aggregation
+
+RUN_DEPENDS= node:${PORTSDIR}/www/node
+
+NO_BUILD= yes
+FETCH_ARGS= -Fpr
+
+USERS= statsd
+GROUPS= statsd
+USE_RC_SUBR= statsd
+SUB_FILES+= statsd
+SUB_LIST+= USERS=${USERS} GROUPS=${GROUPS}
+
+post-patch:
+ @${REINPLACE_CMD} \
+ -e 's;\./;${DATADIR}/;' \
+ ${WRKSRC}/stats.js
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${DATADIR}/backends
+ (cd ${WRKSRC}/backends/ && ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}/backends)
+ ${MKDIR} ${STAGEDIR}${DATADIR}/lib
+ (cd ${WRKSRC}/lib/ && ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}/lib)
+ ${CP} ${WRKSRC}/exampleConfig.js ${STAGEDIR}${DATADIR}/exampleConfig.js
+ ${CP} ${WRKSRC}/exampleProxyConfig.js ${STAGEDIR}${DATADIR}/exampleProxyConfig.js
+ ${CP} ${WRKSRC}/stats.js ${STAGEDIR}${DATADIR}/stats.js
+
+post-install:
+ @${INSTALL_DATA} ${WRKSRC}/exampleConfig.js \
+ ${STAGEDIR}${PREFIX}/etc/statsd.js.sample
+
+.include <bsd.port.mk>
diff --git a/net-mgmt/statsd/distinfo b/net-mgmt/statsd/distinfo
new file mode 100644
index 000000000000..8b23bfc02333
--- /dev/null
+++ b/net-mgmt/statsd/distinfo
@@ -0,0 +1,2 @@
+SHA256 (statsd-0.7.0.tar.gz) = a398f08eac233e5d58b11d22febd2afee7d27f89112d97fe0035eda77aee065e
+SIZE (statsd-0.7.0.tar.gz) = 51073
diff --git a/net-mgmt/statsd/files/statsd.in b/net-mgmt/statsd/files/statsd.in
new file mode 100644
index 000000000000..73d791e2cc17
--- /dev/null
+++ b/net-mgmt/statsd/files/statsd.in
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: statsd
+# REQUIRE: NETWORK
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable mysql:
+# statsd_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable statsd.
+# statsd_config (str): Default to "%%PREFIX%%/etc/statsd.js"
+# Statsd configuration file.
+# statsd_user (str): Default to "statsd".
+# User to run as.
+
+. /etc/rc.subr
+
+name=statsd
+rcvar=statsd_enable
+load_rc_config $name
+
+# set defaults
+: ${statsd_enable:=NO}
+: ${statsd_config="%%PREFIX%%/etc/statsd.js"}
+: ${statsd_user="%%USERS%%"}
+
+pidfile="/var/run/statsd/${name}.pid"
+
+required_files="${statsd_config}"
+
+command=/usr/sbin/daemon
+command_args="-cf -p ${pidfile} %%PREFIX%%/bin/node %%DATADIR%%/stats.js ${statsd_config}"
+procname="${name}"
+stop_postcmd="rm -f $pidfile"
+start_precmd="install -d -o statsd -g statsd ${pidfile%/*}"
+
+run_rc_command "$1"
diff --git a/net-mgmt/statsd/pkg-descr b/net-mgmt/statsd/pkg-descr
new file mode 100644
index 000000000000..45801be007d0
--- /dev/null
+++ b/net-mgmt/statsd/pkg-descr
@@ -0,0 +1,5 @@
+A network daemon that runs on the Node.js platform and listens for statistics,
+like counters and timers, sent over UDP and sends aggregates to one or more
+pluggable backend services (e.g., Graphite).
+
+WWW: https://github.com/etsy/statsd
diff --git a/net-mgmt/statsd/pkg-plist b/net-mgmt/statsd/pkg-plist
new file mode 100644
index 000000000000..980e97d9249f
--- /dev/null
+++ b/net-mgmt/statsd/pkg-plist
@@ -0,0 +1,19 @@
+%%DATADIR%%/backends/console.js
+%%DATADIR%%/backends/graphite.js
+%%DATADIR%%/backends/repeater.js
+%%DATADIR%%/exampleConfig.js
+%%DATADIR%%/exampleProxyConfig.js
+%%DATADIR%%/lib/config.js
+%%DATADIR%%/lib/helpers.js
+%%DATADIR%%/lib/logger.js
+%%DATADIR%%/lib/mgmt_console.js
+%%DATADIR%%/lib/process_metrics.js
+%%DATADIR%%/lib/process_mgmt.js
+%%DATADIR%%/lib/set.js
+%%DATADIR%%/stats.js
+@unexec if cmp -s %D/etc/statsd.js.sample %D/etc/statsd.js; then rm -f %D/etc/statsd.js; fi
+etc/statsd.js.sample
+@exec [ -f %B/statsd.js ] || cp %B/%f %B/statsd.js
+@dirrmtry %%DATADIR%%/lib
+@dirrmtry %%DATADIR%%/backends
+@dirrmtry %%DATADIR%%