🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #16659

Re: News article count report needed

#16659
From: Gary Funck
Date: Thu, 03 Apr 1997 00:00
155 lines
6565 bytes
Brad Groshok <brad@odyssey.on.ca> wrote:
> Does anybody have a script to generate a list of the number of
> articles that are currently being stored in each group.
> and / or 
> also list the HD usage per group named.
> Just thought I'd ask before I did one myself.
> Looking to tune the expire.ctl file a bit.

A while ago, I wrote a program that processes the news history
file, and produces a set of article counts per group as well as
histogram of article counts that will expire at various timeframes.
Since this program reads the history file, it is a good bit faster
than programs that read the full news hierarchy.  Histstats is
derived from C-news sources, but works equally well with INN based
systems.


Histstats can be fetched from:
    ftp://intrepid.intrepid.com/pub/gary/histstats.shar

Hwere's the README file:

   Subject: histstats - print news history file statistics
   Date: May, 3, 1994
   From: Gary Funck (gary@intrepid.com), Intrepid Technology Inc.

Histstats is a program that aids in the maintenance of the Unix
news article spool area. Histstats reads the news article 'history'
database and prints statistics on the total number of articles
filed in each group or hierarchy. Optionally, a form of histogram
is printed, giving the count of articles received at various
time intervals prior to a specified date.

The article counts and histogram produced by histstats can be used
by the news administrator to determine the relative amount of
space consumed by each group or hierarchy.  The histogram can
be used to give feedback on the amount of space that might be
gained by imposing a particular article expiration strategy.

The command summary for 'histstats', extracted from the
'expire' manpage, is given below:

NAME
     histstats - print history file statistics

SYNOPSIS
     /usr/lib/newsbin/expire/histstats [ -g ] [ -v ]
     [ -H history_dir ] [ -F c ] [ -n nnnnn ] [ -d ]

DESCRIPTION

     Histstats scans the history file and prints statistics.  A
     line is printed for each group, and each news hierarchy that
     has one or more articles.  By default, each line in the out-
     put contains the group or hierarchy name followed by the
     total number of articles contained in the group or hierar-
     chy.

     If the -v (verbose) option is given, a line is printed giv-
     ing a form of histogram, listing the number of articles that
     have arrived within various time intervals, based on the
     number of days that have passed since the article was
     received.  Each line gives the group or hierarchy name fol-
     lowed by a series of numbers.  The first number gives the
     total number of articles in the group or hierarchy.  The
     next seven numbers give the total number of articles
     received before today, yesterday, and so on for the past
     week.  The next three numbers give the number of articles
     that arrived two weeks prior to today, three weeks prior to
     today, and one month prior to today.  The last two numbers
     give the number of articles that were received two months
     prior to today, and three months prior to today.

     For example, the default output for the `comp' news hierar-
     chy might appear as follows:

     comp 155021


     If the -v option is given, the output might appear as fol-
     lows:

     comp 155021 145306 145306 141588 131768 122472 115536 108891 101830 60054 10406 3157 2

     where:

        155021 is the total number of articles in the hierarchy
        145306 were received prior to today
        145306 were received prior to yesterday
        141588 were received prior to day before yesterday
        131768 were received prior to 3 days ago
        122472 were received prior to 4 days ago
        115536 were received prior to 5 days ago
        108891 were received prior to 6 days ago
        101830 were received prior to 2 weeks ago
         60054 were received prior to 3 weeks ago
         10406 were received prior to 1 month ago
          3157 were received prior to 2 months ago
             2 were received prior to 3 months ago

     Normally, histstats prints a line for each group or hierar-
     chy.  If the -g option is given, then a line will be printed
     only for groups.  No summary information will be printed for
     hierarchies.

     Histstats accepts a few other switches that are seldom used.
     The -H switch supplies the name of a directory, other than
     /usr/lib/news as the directory containing the `history'
     file.  The -n switch supplies an explicit date to be used to
     calculate the number of days that have passed since an arti-
     cle arrived.

INSTALLATION
------------

Histstats is derived from the C News 'expire' program, and is
built in the cnews/expire directory.  Here are the steps required
to install 'histstats':

1. Login as the news administrator, and 'cd' to the directory
   where the cnews sources are located.  (The C news source
   directory is called 'cnews' in the instructions below.)

2. Copy histstats.c into the cnews/expire source directory.

3. Copy the expire.8 manpage into the cnews/man directory, or
   update the existing expire.8 manpage, using the expire.8.diffs file.

4. Add histstats to the 'THEM' make variable in the cnews/expire Makefile
   as shown below:

    THEM = expire histdups histinfo histslash histstats mkhistory \
	    upact doexpire mkadir recovact expireiflow

5. Add a step in the cnews/expire Makefile to build histstats
   as shown below:

   histstats: histstats.o $(LIBS)
	    $(CC) $(CFLAGS) $(LDFLAGS) histstats.o \
		  $(PRE) $(DBM) $(LIBS) $(POST) -o $@

6. Make 'install' in the neews/expire directory, and in
   the cnews/man directory.

7. Try running histstats by entering the command
   
       % histstats > article.counts

   or
   
       % histstats -v > article.histogram


Technical Details
Message-ID: <5i26b0$sbe$1@intrepid.intrepid.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <333a9cc9.242029281@207.107.112.2>

Show Full Headers
Complete Article Headers
Message-ID: <5i26b0$sbe$1@intrepid.intrepid.com>
Subject: Re: News article count report needed
Date: Thu, 03 Apr 1997 00:00:00 +0000
From: Gary Funck <gary@intrepid.com>
References: <333a9cc9.242029281@207.107.112.2>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 230597030
Organization: Intrepid Technology Inc.
Newsgroups: news.software.nntp