summaryrefslogtreecommitdiffstats
path: root/system/apachetop
diff options
context:
space:
mode:
author Willy Sudiarto Raharjo2023-02-18 03:24:29 +0100
committer Willy Sudiarto Raharjo2023-02-18 03:24:29 +0100
commit972328a73dc397ae2112aa8955be711edc037bbf (patch)
tree8fe4fd9121c8ef8e6b9363fd30f0dd3f3fa7e8c4 /system/apachetop
parentfb70acbb6420f3f1e57a23fa0768f0580f968f9c (diff)
downloadslackbuilds-972328a73dc397ae2112aa8955be711edc037bbf.tar.gz
system/apachetop: Updated for version 0.23.2.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/apachetop')
-rw-r--r--system/apachetop/apachetop.SlackBuild7
-rw-r--r--system/apachetop/apachetop.info6
-rw-r--r--system/apachetop/apachetop.outputfile.patch239
3 files changed, 5 insertions, 247 deletions
diff --git a/system/apachetop/apachetop.SlackBuild b/system/apachetop/apachetop.SlackBuild
index 42853befcc..2d18709962 100644
--- a/system/apachetop/apachetop.SlackBuild
+++ b/system/apachetop/apachetop.SlackBuild
@@ -12,7 +12,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=apachetop
-VERSION=${VERSION:-0.19.7}
+VERSION=${VERSION:-0.23.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -25,9 +25,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -68,7 +65,7 @@ find -L . \
# Apply a patch by Aaron McClimont to allow writing statistics to a file.
# For like MRTG to use (or Cricket, Cacti, Torrus, whatever).
-patch -p0 < $CWD/apachetop.outputfile.patch
+#patch -p0 < $CWD/apachetop.outputfile.patch
# Add mension of the feature added above to the manpage.
patch -p0 < $CWD/apachetop.manpage.diff
diff --git a/system/apachetop/apachetop.info b/system/apachetop/apachetop.info
index e4f5665b2b..aaecdc7193 100644
--- a/system/apachetop/apachetop.info
+++ b/system/apachetop/apachetop.info
@@ -1,8 +1,8 @@
PRGNAM="apachetop"
-VERSION="0.19.7"
+VERSION="0.23.2"
HOMEPAGE="https://github.com/tessus/apachetop"
-DOWNLOAD="https://github.com/tessus/apachetop/archive/0.19.7/apachetop-0.19.7.tar.gz"
-MD5SUM="a1b7d9d21794fbcc87bc6efc66320a21"
+DOWNLOAD="https://github.com/tessus/apachetop/archive/0.23.2/apachetop-0.23.2.tar.gz"
+MD5SUM="ec77c32d9ff19809a3ddeb500ad306e5"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/system/apachetop/apachetop.outputfile.patch b/system/apachetop/apachetop.outputfile.patch
deleted file mode 100644
index 95e484370c..0000000000
--- a/system/apachetop/apachetop.outputfile.patch
+++ /dev/null
@@ -1,239 +0,0 @@
-Index: src/apachetop.cc
-===================================================================
---- src/apachetop.cc (revision 873)
-+++ src/apachetop.cc (revision 874)
-@@ -85,6 +85,7 @@
- cf.debug = true;
- cf.current_display_size = 0;
- cf.input_count = 0;
-+ cf.output_file = "";
- cf.circle_size = DEFAULT_CIRCLE_SIZE;
- cf.circle_mode = DEFAULT_CIRCLE_MODE;
- cf.sort = DEFAULT_SORT;
-@@ -136,7 +137,7 @@
- #endif
-
- /* process commandline {{{ */
-- while ((ch = getopt(argc, argv, "f:H:T:hvqlrs:pd:")) != -1)
-+ while ((ch = getopt(argc, argv, "f:o:H:T:hqlrs:pd:")) != -1)
- {
- switch(ch)
- {
-@@ -150,6 +151,9 @@
- else
- cf.input_count++;
- break;
-+ case 'o':
-+ cf.output_file = optarg;
-+ break;
- case 'T':
- x = atoi(optarg);
- seen_t = true;
-@@ -1043,24 +1047,25 @@
- fprintf(stderr,
- "ApacheTop v%s - Usage:\n"
- "File options:\n"
-- " -f logfile open logfile (assumed common/combined) [%s]\n"
-- " (repeat option for more than one source)\n"
-+ " -f logfile open logfile (assumed common/combined) [%s]\n"
-+ " (repeat option for more than one source)\n"
-+ " -o outfile output logfile\n"
- "\n"
- "URL/host/referrer munging options:\n"
-- " -q keep query strings [%s]\n"
-- " -l lowercase all URLs [%s]\n"
-- " -s num keep num path segments of URL [all]\n"
-- " -p preserve protocol at front of referrers [%s]\n"
-- " -r resolve hostnames/IPs into each other [%s]\n"
-+ " -q keep query strings [%s]\n"
-+ " -l lowercase all URLs [%s]\n"
-+ " -s num keep num path segments of URL [all]\n"
-+ " -p preserve protocol at front of referrers [%s]\n"
-+ " -r resolve hostnames/IPs into each other [%s]\n"
- "\n"
- "Stats options:\n"
- " Supply up to one of the following two. default: [-%c %d]\n"
-- " -H hits remember stats for this many hits\n"
-- " -T secs remember stats for this many seconds\n"
-+ " -H hits remember stats for this many hits\n"
-+ " -T secs remember stats for this many seconds\n"
- "\n"
-- " -d secs refresh delay in seconds [%d]\n"
-+ " -d secs refresh delay in seconds [%d]\n"
- "\n"
- " -v show version\n"
-- " -h this help\n"
-+ " -h this help\n"
- "\n"
- "Compile Options: %cHAVE_KQUEUE %cHAVE_FAM %cENABLE_PCRE\n"
- "Polling Method: %s\n"
-Index: src/display.cc
-===================================================================
---- src/display.cc (revision 873)
-+++ src/display.cc (revision 874)
-@@ -22,6 +22,7 @@
- extern itemlist *items;
- extern map *last_display_map;
-
-+FILE *outputFile;
-
- bool display(time_t last_display) /* {{{ */
- {
-@@ -174,11 +175,21 @@
- move(0, 0);
- clrtoeol();
-
-+ if (cf.output_file != "") {
-+ // Open the file.
-+ outputFile = fopen (cf.output_file, "wt");
-+ }
-+
- /* last hit */
- secs_offset = gstats.alltime.last % 86400;
- mvprintw(0, 0, "last hit: %02d:%02d:%02d",
- secs_offset / 3600, (secs_offset / 60) % 60, secs_offset % 60);
-
-+ if (cf.output_file != "") {
-+ fprintf(outputFile, "last hit: %02d:%02d:%02d\n",
-+ secs_offset / 3600, (secs_offset / 60) % 60, secs_offset % 60);
-+ }
-+
- /* uptime */
- diff = (unsigned int)difftime(now, gstats.start);
- if (diff > 86399) diff -= ((d = diff / 86400)*86400);
-@@ -186,6 +197,9 @@
- if (diff > 59) diff -= ((m = diff / 60)*60);
- s = diff;
- mvprintw(0, 27, "atop runtime: %2d days, %02d:%02d:%02d", d, h, m, s);
-+ if (cf.output_file != "") {
-+ fprintf(outputFile, "atop runtime: %2d days, %02d:%02d:%02d\n", d, h, m, s);
-+ }
-
- /* are we paused? */
- if (cf.display_paused)
-@@ -197,6 +211,10 @@
- secs_offset = now % 86400;
- mvprintw(0, 71, "%02d:%02d:%02d",
- secs_offset /3600, (secs_offset/ 60) % 60, secs_offset % 60);
-+ if (cf.output_file != "") {
-+ fprintf(outputFile, "current time: %02d:%02d:%02d\n",
-+ secs_offset /3600, (secs_offset/ 60) % 60, secs_offset % 60);
-+ }
-
-
- //All: 1,140,532 requests (39.45/sec), 999,540,593 bytes (857,235/sec)
-@@ -215,6 +233,15 @@
- bps, bps_suffix,
- per_req, per_req_suffix);
- attroff(A_BOLD);
-+ if (cf.output_file != "") {
-+ fprintf(outputFile,
-+ "All: %12.0f reqs (%6.1f/sec) %11.1f%c (%7.1f%c/sec) %7.1f%c/req\n",
-+ gstats.alltime.reqcount,
-+ gstats.alltime.reqcount/ftmp,
-+ bytes, bytes_suffix,
-+ bps, bps_suffix,
-+ per_req, per_req_suffix);
-+ }
-
-
- // 2xx 1,604,104 (95%) 3xx 1,000,000 ( 3%) 4xx 1,000,000 ( 1%)
-@@ -244,6 +271,29 @@
-
- );
-
-+ if (cf.output_file != "") {
-+ fprintf(outputFile,
-+ "2xx: %7.0f (%4.*f%%) 3xx: %7.0f (%4.*f%%) "
-+ "4xx: %5.0f (%4.*f%%) 5xx: %5.0f (%4.*f%%)\n",
-+
-+ gstats.r_codes[2].reqcount,
-+ (gstats.r_codes[2].reqcount/ftmp) == 1 ? 0 : 1,
-+ (gstats.r_codes[2].reqcount/ftmp)*100,
-+
-+ gstats.r_codes[3].reqcount,
-+ (gstats.r_codes[3].reqcount/ftmp) == 1 ? 0 : 1,
-+ (gstats.r_codes[3].reqcount/ftmp)*100,
-+
-+ gstats.r_codes[4].reqcount,
-+ (gstats.r_codes[4].reqcount/ftmp) == 1 ? 0 : 1,
-+ (gstats.r_codes[4].reqcount/ftmp)*100,
-+
-+ gstats.r_codes[5].reqcount,
-+ (gstats.r_codes[5].reqcount/ftmp) == 1 ? 0 : 1,
-+ (gstats.r_codes[5].reqcount/ftmp)*100
-+ );
-+ }
-+
- /* housecleaning on the circle, if its required in this class */
- c->updatestats();
- /* fetch the time of the first "recent" request */
-@@ -263,6 +313,16 @@
- per_req, per_req_suffix
- );
- attroff(A_BOLD);
-+ if (cf.output_file != "") {
-+ fprintf(outputFile,
-+ "R (%3ds): %7.0f reqs (%6.1f/sec) %11.1f%c (%7.1f%c/sec) %7.1f%c/req\n",
-+ itmp, c->getreqcount(),
-+ ((float)c->getreqcount()/itmp),
-+ bytes, bytes_suffix,
-+ bps, bps_suffix,
-+ per_req, per_req_suffix
-+ );
-+ }
-
- ftmp = c->getsummary(2) + c->getsummary(3) +
- c->getsummary(4) + c->getsummary(5);
-@@ -286,6 +346,27 @@
- (c->getsummary(5)/ftmp) == 1 ? 0 : 1,
- (c->getsummary(5)/ftmp)*100
- );
-+ if (cf.output_file != "") {
-+ fprintf(outputFile,
-+ "R2xx: %6.0f (%4.*f%%) R3xx: %6.0f (%4.*f%%) "
-+ "R4xx: %4.0f (%4.*f%%) R5xx: %4.0f (%4.*f%%)\n",
-+ c->getsummary(2),
-+ (c->getsummary(2)/ftmp) == 1 ? 0 : 1,
-+ (c->getsummary(2)/ftmp)*100,
-+
-+ c->getsummary(3),
-+ (c->getsummary(3)/ftmp) == 1 ? 0 : 1,
-+ (c->getsummary(3)/ftmp)*100,
-+
-+ c->getsummary(4),
-+ (c->getsummary(4)/ftmp) == 1 ? 0 : 1,
-+ (c->getsummary(4)/ftmp)*100,
-+
-+ c->getsummary(5),
-+ (c->getsummary(5)/ftmp) == 1 ? 0 : 1,
-+ (c->getsummary(5)/ftmp)*100
-+ );
-+ }
-
- // mvprintw(5, 0,
- // "Unique Objects: Size Footprint:");
-@@ -315,6 +396,11 @@
-
- }
-
-+ if (cf.output_file != "") {
-+ // Close the file.
-+ fclose (outputFile);
-+ }
-+
- } /* }}} */
-
- void display_list() /* {{{ */
-Index: src/apachetop.h
-===================================================================
---- src/apachetop.h (revision 873)
-+++ src/apachetop.h (revision 874)
-@@ -138,6 +138,7 @@
- short current_display_size; /* how many lines we're displaying */
-
- short input_count;
-+ char *output_file;
-
- #define TIMED_CIRCLE 'T'
- #define HITS_CIRCLE 'H'