From ccb3a11c4c3633a9ce83cb5f63bbdfe27b7cfcd5 Mon Sep 17 00:00:00 2001 From: Steve Wills Date: Sun, 22 Dec 2013 16:25:58 +0000 Subject: 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 --- net-mgmt/statsd/Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ net-mgmt/statsd/distinfo | 2 ++ net-mgmt/statsd/files/statsd.in | 40 ++++++++++++++++++++++++++++++++++++++++ net-mgmt/statsd/pkg-descr | 5 +++++ net-mgmt/statsd/pkg-plist | 19 +++++++++++++++++++ 5 files changed, 106 insertions(+) create mode 100644 net-mgmt/statsd/Makefile create mode 100644 net-mgmt/statsd/distinfo create mode 100644 net-mgmt/statsd/files/statsd.in create mode 100644 net-mgmt/statsd/pkg-descr create mode 100644 net-mgmt/statsd/pkg-plist (limited to 'net-mgmt/statsd') 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 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%% -- cgit v1.2.3