From owner-freebsd-ports-bugs@FreeBSD.ORG Thu May 9 08:10:03 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3AC661F5 for ; Thu, 9 May 2013 08:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 216017D1 for ; Thu, 9 May 2013 08:10:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r498A3DH082889 for ; Thu, 9 May 2013 08:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r498A29J082888; Thu, 9 May 2013 08:10:02 GMT (envelope-from gnats) Resent-Date: Thu, 9 May 2013 08:10:02 GMT Resent-Message-Id: <201305090810.r498A29J082888@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Hung-Yi Chen Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8037E194 for ; Thu, 9 May 2013 08:05:56 +0000 (UTC) (envelope-from gaod@cse.tw) Received: from cse.tw (cse.tw [140.138.145.234]) by mx1.freebsd.org (Postfix) with ESMTP id 390717A7 for ; Thu, 9 May 2013 08:05:56 +0000 (UTC) Received: from cse.tw (localhost [127.0.0.1]) by cse.tw (Postfix) with ESMTP id 01AC7187B534 for ; Thu, 9 May 2013 16:06:09 +0800 (CST) Received: (from gaod@localhost) by cse.tw (8.14.5/8.14.5/Submit) id r49868kM031305; Thu, 9 May 2013 16:06:08 +0800 (CST) (envelope-from gaod) Message-Id: <201305090806.r49868kM031305@cse.tw> Date: Thu, 9 May 2013 16:06:08 +0800 (CST) From: Hung-Yi Chen To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/178441: [NEW PORT] databases/memkeys: A tool to show memcache key usage in realtime X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Hung-Yi Chen List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 08:10:03 -0000 >Number: 178441 >Category: ports >Synopsis: [NEW PORT] databases/memkeys: A tool to show memcache key usage in realtime >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu May 09 08:10:01 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Hung-Yi Chen >Release: FreeBSD 9.1-RELEASE amd64 >Organization: >Environment: System: FreeBSD cse.tw 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Show your memcache key usage in realtime. This was originally inspired by mctop from etsy. WWW: https://github.com/tumblr/memkeys >How-To-Repeat: >Fix: --- memkeys.diff begins here --- Index: databases/Makefile =================================================================== --- databases/Makefile (revision 317561) +++ databases/Makefile (working copy) @@ -198,6 +198,7 @@ SUBDIR += memcached12 SUBDIR += memcachedb SUBDIR += memcacheq + SUBDIR += memkeys SUBDIR += mergeant SUBDIR += metakit SUBDIR += mird Index: databases/memkeys/Makefile =================================================================== --- databases/memkeys/Makefile (revision 0) +++ databases/memkeys/Makefile (working copy) @@ -0,0 +1,34 @@ +# Created by: Hung-Yi Chen +# $FreeBSD$ + +PORTNAME= memkeys +PORTVERSION= 20130503 +CATEGORIES= devel +MASTER_SITES= GH GHC +DISTNAME= ${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT} + +MAINTAINER= gaod@hychen.org +COMMENT= A tool to show your memcache key usage in realtime + +LICENSE= AL2 + +PLIST_FILES= bin/memkeys + +USE_GITHUB= yes +GH_ACCOUNT= tumblr +GH_PROJECT= memkeys +GH_COMMIT= 75fc345 +GH_TAGNAME= ${GH_COMMIT} +USE_GMAKE= yes +USE_GCC= 4.6+ +GNU_CONFIGURE= yes +USE_AUTOTOOLS= libtool:env aclocal:env autoheader:env automake:env autoconf:env + +CONFIGURE_ARGS+= --prefix=${PREFIX}/${PORTNAME} + +WRKSRC= ${WRKDIR}/${DISTNAME} + +pre-configure: + cd ${WRKSRC}; ${SH} autogen.sh + +.include Index: databases/memkeys/distinfo =================================================================== --- databases/memkeys/distinfo (revision 0) +++ databases/memkeys/distinfo (working copy) @@ -0,0 +1,2 @@ +SHA256 (tumblr-memkeys-75fc345.tar.gz) = 80017b28b2f0c6779de62e7f46dca31dcdcc8ef3b0d64597bb7db3184af790cc +SIZE (tumblr-memkeys-75fc345.tar.gz) = 34083 Index: databases/memkeys/files/patch-configure.ac =================================================================== --- databases/memkeys/files/patch-configure.ac (revision 0) +++ databases/memkeys/files/patch-configure.ac (working copy) @@ -0,0 +1,11 @@ +--- /net/account/admin/gaod/memkeys/configure.ac 2013-05-07 05:17:51.035222000 +0800 ++++ configure.ac 2013-05-07 03:45:51.000000000 +0800 +@@ -14,7 +14,7 @@ + + # Checks for programs + CXXFLAGS="$CXXFLAGS -std=c++0x" # Will fail if not g++44 or later +-AC_PROG_CXX([g++44 g++ gcc cxx cc++ c++]) ++AC_PROG_CXX([g++46 g++47 g++48 g++49 g++ gcc cxx cc++ c++]) + AC_PROG_CXXCPP + CXXCPP="$CXXCPP -std=c++0x" # This must come after AC_PROG_CXXCPP + AC_PROG_LIBTOOL Index: databases/memkeys/files/patch-src_config.cpp =================================================================== --- databases/memkeys/files/patch-src_config.cpp (revision 0) +++ databases/memkeys/files/patch-src_config.cpp (working copy) @@ -0,0 +1,21 @@ +--- /net/account/admin/gaod/memkeys/src/config.cpp 2013-05-07 05:17:51.066194000 +0800 ++++ src/config.cpp 2013-05-07 04:23:42.000000000 +0800 +@@ -1,6 +1,7 @@ + #include "common.h" + #include + #include ++#include + + namespace mckeys { + +@@ -81,7 +82,9 @@ + } + string Config::getPortAsString() const + { +- return to_string((llui_t)getPort()); ++ stringstream strstream; ++ strstream << (llui_t)getPort(); ++ return strstream.str(); + } + + /** Index: databases/memkeys/files/patch-src_logging_record.cpp =================================================================== --- databases/memkeys/files/patch-src_logging_record.cpp (revision 0) +++ databases/memkeys/files/patch-src_logging_record.cpp (working copy) @@ -0,0 +1,18 @@ +--- /net/account/admin/gaod/memkeys/src/logging/record.cpp 2013-05-07 05:17:51.075182000 +0800 ++++ src/logging/record.cpp 2013-05-07 03:56:52.000000000 +0800 +@@ -1,5 +1,6 @@ + #include + #include ++#include + + extern "C" { + #include +@@ -142,7 +143,7 @@ + strftime(buffer, 80, "%Y%m%d-%H:%M:%S", timeinfo); + + char result[100] = {0}; +- std::snprintf(result, 100, "%s.%03ld", buffer, (long)tv.tv_usec / 1000); ++ snprintf(result, 100, "%s.%03ld", buffer, (long)tv.tv_usec / 1000); + return result; + } + Index: databases/memkeys/files/patch-src_memkeys.cpp =================================================================== --- databases/memkeys/files/patch-src_memkeys.cpp (revision 0) +++ databases/memkeys/files/patch-src_memkeys.cpp (working copy) @@ -0,0 +1,21 @@ +--- /net/account/admin/gaod/memkeys/src/memkeys.cpp 2013-05-07 05:17:51.078181000 +0800 ++++ src/memkeys.cpp 2013-05-07 05:12:55.000000000 +0800 +@@ -1,6 +1,7 @@ + #include + #include + #include ++#include + + #include "cli.h" + #include "memkeys.h" +@@ -75,7 +76,9 @@ + signal(SIGINT, signal_cb); + state.setState(state_STARTING); + session->open(); +- logger->debug("My address: " + to_string((llsi_t)session->getIpAddress())); ++ stringstream strstream; ++ strstream << (llsi_t)session->getIpAddress(); ++ logger->debug("My address: " + strstream.str()); + session->setFilter(string("tcp port ") + config->getPortAsString()); + try { + state.setState(state_RUNNING); Index: databases/memkeys/files/patch-src_net_capture_engine.cpp =================================================================== --- databases/memkeys/files/patch-src_net_capture_engine.cpp (revision 0) +++ databases/memkeys/files/patch-src_net_capture_engine.cpp (working copy) @@ -0,0 +1,27 @@ +--- /net/account/admin/gaod/memkeys/src/net/capture_engine.cpp 2013-05-07 05:17:51.081178000 +0800 ++++ src/net/capture_engine.cpp 2013-05-07 05:10:50.000000000 +0800 +@@ -3,6 +3,7 @@ + #include "report/report.h" + #include "report/curses.h" + ++#include + #include + + namespace mckeys { +@@ -130,10 +131,14 @@ + string out = getStatsString(); + uint64_t now = UtilTime::currentTimeMillis(); + llui_t tdiff = now - packet.timestamp(); ++ stringstream strstream; ++ strstream << resCount; + out.append(", memcache replies = "); +- out.append(to_string(resCount)); ++ out.append(strstream.str()); ++ strstream.clear(); + out.append(", time diff = "); +- out.append(to_string(tdiff)); ++ strstream << tdiff; ++ out.append(strstream.str()); + logger->debug(out); + } + } else { Index: databases/memkeys/files/patch-src_net_net.h =================================================================== --- databases/memkeys/files/patch-src_net_net.h (revision 0) +++ databases/memkeys/files/patch-src_net_net.h (working copy) @@ -0,0 +1,14 @@ +--- /net/account/admin/gaod/memkeys/src/net/net.h 2013-05-07 05:17:51.088168000 +0800 ++++ src/net/net.h 2013-05-07 05:04:18.000000000 +0800 +@@ -1,6 +1,11 @@ + #ifndef _NET_NET_H + #define _NET_NET_H + ++#include ++#include ++#include ++#include ++ + extern "C" { + #include + } Index: databases/memkeys/pkg-descr =================================================================== --- databases/memkeys/pkg-descr (revision 0) +++ databases/memkeys/pkg-descr (working copy) @@ -0,0 +1,3 @@ +A top like tool for inspecting memcache key values in realtime. + +WWW: https://github.com/tumblr/memkeys --- memkeys.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: