tools/prstats: remove it

This this is specific to GNATS which FreeBSD no longer uses.
This commit is contained in:
Eitan Adler 2017-12-11 07:05:27 +00:00
parent b004319511
commit 5dc9d36fd3
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=51289
5 changed files with 0 additions and 203 deletions

View file

@ -1,46 +0,0 @@
#
# $FreeBSD$
#
.if exists(../../../en_US.ISO8859-1/Makefile.conf)
.include "../../../en_US.ISO8859-1/Makefile.conf"
.endif
.if exists(../../../en_US.ISO8859-1/Makefile.inc)
.include "../../../en_US.ISO8859-1/Makefile.inc"
.endif
DOC_PREFIX?= ${.CURDIR}/../../..
GNATSDIR?= /c/gnats
PRGRAPHDIR?= ${DESTDIR}${WEBBASE}/prstats
GNUPLOT?= /usr/local/bin/gnuplot
GRAPHS= gnats.png
GRAPHS+= gnats1.png gnats1r.png
GRAPHS+= gnats30.png gnats30r.png
GRAPHS+= gnats365.png gnats365r.png
GRAPHS+= gnats7.png gnats7r.png
CLEANFILES= ${GRAPHS}
CLEANFILES+= _ __ __1 __30 __365 __7
INSTALL_WEB?= \
${INSTALL} ${COPY} ${INSTALLFLAGS} -o ${WEBOWN} -g ${WEBGRP} -m ${WEBMODE}
all:
./go.tcl ${GNATSDIR}
./eval.tcl
./cut.tcl 365 __ __365
./cut.tcl 30 __ __30
./cut.tcl 7 __ __7
./cut.tcl 1 __ __1
${GNUPLOT} g
install: ${GRAPHS}
.for entry in ${GRAPHS}
.if exists(${.CURDIR}/${entry})
${INSTALL_WEB} ${.CURDIR}/${entry} ${PRGRAPHDIR}
.else
${INSTALL_WEB} ${entry} ${PRGRAPHDIR}
.endif
.endfor
.include "${DOC_PREFIX}/share/mk/web.site.mk"

View file

@ -1,15 +0,0 @@
#!/usr/local/bin/tclsh8.3
#
# $FreeBSD$
#
set t [clock seconds]
set t0 [expr $t - [lindex $argv 0] * 86400]
set fi [open [lindex $argv 1]]
set fo [open [lindex $argv 2] w]
while {[gets $fi a] >= 0} {
if {[lindex $a 2] > $t0} {
puts $fo $a
}
}

View file

@ -1,33 +0,0 @@
#!/usr/local/bin/tclsh8.3
#
# $FreeBSD$
#
set fi [open "|sort -n _"]
set fo [open "__" w]
set v {open feedback analyzed suspended patched closed }
foreach i $v {
set $i 0
}
set m 0
while {[gets $fi a] >= 0} {
if {![regexp {^[0-9]*$} [lindex $a 1]]} {
puts "Bogus: $a"
continue
}
if {[catch {eval [string tolower [lindex $a 2]]}]} {
puts $a
}
if {[lindex $a 1] > $m} {
set m [lindex $a 1].0
}
puts -nonewline $fo [clock format [lindex $a 0] -format "%Y/%m/%d %H:%M" -gmt true]
puts -nonewline $fo " [lindex $a 0]"
foreach i $v {
set j [set $i]
#puts -nonewline $fo " [expr $j / $m]"
puts -nonewline $fo " $j"
}
puts $fo ""
}

View file

@ -1,61 +0,0 @@
# $FreeBSD$
#
set term png small
set xdata time
set timefmt "%Y/%m/%d %H:%M"
set data style line
set grid
set key left
set output "gnats.png"
set format x "%Y"
plot '__' using 1:4 title "open", \
'__' using 1:5 title "feedback", \
'__' using 1:6 title "analyzed" , \
'__' using 1:7 title "suspended", \
'__' using 1:8 title "patched"
set output "gnats1.png"
set format x "%H:%M"
plot '__1' using 1:4 title "open" with linespo, \
'__1' using 1:5 title "feedback", \
'__1' using 1:6 title "analyzed" , \
'__1' using 1:7 title "suspended", \
'__1' using 1:8 title "patched"
set output "gnats1r.png"
plot '__1' using 1:4 title "open" with linespo
set output "gnats7.png"
set format x "%m/%d"
plot '__7' using 1:4 title "open", \
'__7' using 1:5 title "feedback", \
'__7' using 1:6 title "analyzed" , \
'__7' using 1:7 title "suspended", \
'__7' using 1:8 title "patched"
set output "gnats7r.png"
plot '__7' using 1:4 title "open"
set output "gnats30.png"
set format x "%Y/%m/%d"
plot '__30' using 1:4 title "open", \
'__30' using 1:5 title "feedback", \
'__30' using 1:6 title "analyzed" , \
'__30' using 1:7 title "suspended", \
'__30' using 1:8 title "patched"
set output "gnats30r.png"
plot '__30' using 1:4 title "open"
set output "gnats365.png"
set format x "%Y/%m/%d"
plot '__365' using 1:4 title "open", \
'__365' using 1:5 title "feedback", \
'__365' using 1:6 title "analyzed" , \
'__365' using 1:7 title "suspended", \
'__365' using 1:8 title "patched"
set output "gnats365r.png"
plot '__365' using 1:4 title "open"

View file

@ -1,48 +0,0 @@
#!/usr/local/bin/tclsh8.3
#
# $FreeBSD$
#
# This script expects the directory of a GNATS database as its sole argument.
set gnatsdir [lindex $argv 0]
set fo [open _ w]
proc PR {fn} {
global fo
set n [lrange [split $fn /] end end]
set openrc [catch {set fi [open $fn]} openerr]
if {$openrc != 0} {return $openrc}
while {[gets $fi a] >= 0} {
if {[string range $a 0 12] == "State-Changed"} {
if {[lindex $a 0] == "State-Changed-When:"} {
set t [clock scan [lrange $a 1 end]]
#puts "* $t"
}
if {[lindex $a 0] == "State-Changed-From-To:"} {
regsub {\->*[ ]*} [lrange $a 1 end] { } d
set b [lindex $d 1]
set c [lindex $d 0]
if {$b == "" || $c == ""} {
puts stderr "$n <$a> <$d> <$b> <$c>"
break
}
#puts "* - $c + $b"
}
if {[lindex $a 0] == "State-Changed-Why:"} {
puts $fo "$t $n {incr $c -1 ; incr $b}"
}
} elseif {[string range $a 0 13] == ">Arrival-Date:"} {
#puts "* $a"
puts $fo "[clock scan [lrange $a 1 end]] $n {incr open}"
} else {
#puts $a
}
}
close $fi
}
append gnatsdir {/*/*[0-9]}
foreach pr [glob $gnatsdir] {
PR $pr
}