Commit 9effb127 authored by Thorsten Simons's avatar Thorsten Simons

1.3.5 - now using *setproctitle* to set more clear process titles (for ps, htop)

parent 00f3af4e
......@@ -74,6 +74,7 @@ Vagrant.configure(2) do |config|
echo LC_ALL=C >> /etc/default/locale
sudo apt-get update
sudo apt-get install htop strace iptraf-ng python3 python3-pip -y
sudo pip3 install --upgrade setuptools pip pyinstaller==3.2.1 xlsxwriter
sudo pip3 install --upgrade setuptools pip pyinstaller==3.2.1 xlsxwriter \
setproctitle
SHELL
end
Release History
===============
**1.3.5 2017-10-30**
* now using *setproctitle* to set more clear process titles (for ps, htop)
**1.3.4 2017-10-13**
* fixed a bug invented in 1.3.3 that caused long running queries to break
......
......@@ -23,6 +23,7 @@
import sys
from time import time
from os.path import exists, join, dirname
from setproctitle import setproctitle
from hcpreq import parseargs
from hcpreq.db import DB
......@@ -77,6 +78,7 @@ def main():
elif opts.cmd == 'load':
if not exists(opts.logpkg):
sys.exit('fatal: log package {} not existent'.format(opts.logpkg))
setproctitle('hcprequestanalytics is loading {}'.format(opts.logpkg))
db = opendb(opts.db, None)
start1 = time()
......@@ -102,6 +104,7 @@ def main():
# run queries against the database
elif opts.cmd == 'analyze':
setproctitle('hcprequestanalytics is analyzing {}'.format(opts.db))
db = opendb(opts.db, opts.additionalqueries)
try:
_st = time()
......@@ -112,6 +115,9 @@ def main():
print('analyze failed: {}'.format(e))
db.close()
else:
sys.exit('use --help')
......
......@@ -29,6 +29,8 @@ from datetime import datetime
from collections import OrderedDict
from concurrent.futures import ProcessPoolExecutor, as_completed, TimeoutError
from tempfile import NamedTemporaryFile
from setproctitle import setproctitle
from hcpreq.queries import Queries
from hcpreq.xlsx import Csv, Xlsx
......@@ -304,6 +306,8 @@ def runquery(db, qtitle, query):
:param query: the query
:return: a list of sqlite3.Row objects
"""
setproctitle('hcprequestanalytics query worker')
# just open this temporary file to be able to identify which query a
# subprocess is running ;-)
with NamedTemporaryFile('w', prefix='I_am__*'+qtitle+'*__') as tmphdl:
......
......@@ -94,9 +94,7 @@ class Handler(object):
for root, dirs, files in walk(self.tmpdir.name):
for f in files:
if not f.startswith('http_gateway_request.log'):
continue
else:
if f.startswith('http_gateway_request.log'):
flist.append(join(root, f))
return flist
......
PyInstaller==3.2.1
Sphinx>=1.6.3
XlsxWriter>=1.0.0
setproctitle==1.1.10
Sphinx==1.6.3
XlsxWriter==1.0.0
XlsxWriter>=1.0.0
setproctitle==1.1.10
XlsxWriter==1.0.0
......@@ -27,8 +27,8 @@ class Gvars:
"""
# version control
s_version = "1.3.4"
s_builddate = '2017-10-13'
s_version = "1.3.5"
s_builddate = '2017-10-30'
s_build = "{}/Sm".format(s_builddate)
s_minPython = "3.4.3"
s_description = "hcprequestanalytics"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment