Commit Graph

262 Commits

Author SHA1 Message Date
Thor77 6366d3ebb1 Show last-seen hint only in Onlinetime-section
currently by filtering by headline (probably not a good long-term-solution)
2017-02-10 23:34:23 +01:00
Thor77 f97f309b85 Move last-seen hint to value
and display it on the left side because last-seen is related to onlinetime and not
to the nick.
2017-02-10 23:33:57 +01:00
Thor77 8d2e0c1345 Add funcdoc for tsstats.template.prepare_clients 2016-11-24 22:57:56 +01:00
Thor77 cb449558e0 Fix onlinetime_threshold not used 2016-11-23 21:23:20 +01:00
Thor77 17a486bb7d Fix incorrectly sorted imports 2016-11-23 21:19:21 +01:00
Thor77 ba47122f50 Sort servers by sid for consistent output 2016-11-23 21:09:11 +01:00
Thor77 ef66b45e21 Prefix clientlist-filter with section-filter
because navbar-entries are also li
2016-11-23 21:06:55 +01:00
Thor77 2cdcdd1e5b Use new, sid-prefixed section-id 2016-11-23 21:06:11 +01:00
Thor77 a96200dafa Update test_debug for new debug-label 2016-11-23 21:04:51 +01:00
Thor77 a3d4cdde5b Use render_servers instead of render_template 2016-11-23 21:02:05 +01:00
Thor77 418be10603 Use render_servers for utf8-write-test 2016-11-22 23:08:49 +01:00
Thor77 42796be9d8 Use render_servers instead of render_template
* limit to one output file for all virtual servers
2016-11-22 23:04:18 +01:00
Thor77 5915664605 Set index.jinja2 as default for General.template 2016-11-22 23:03:51 +01:00
Thor77 062da49244 Rename render_template to render_servers
also includes refactoring for multiserver-output

* now accepts list of servers instead of clients as input
* index.jinja2 is now the default template
2016-11-22 23:02:26 +01:00
Thor77 9a686f7a2f Refactor template(s) for multiserver-display
* all virtual servers are now included in one single outputfile
* navbar for navigation between virtual servers
2016-11-22 22:59:57 +01:00
Thor77 51225175ce Refactor clients preperation into prepare_clients 2016-11-19 22:50:28 +01:00
Thor77 75c5ebb575 Adapt to new return type of tsstats.log.parse_logs
in this case using list- instead of dict-indexing
2016-11-19 22:28:34 +01:00
Thor77 f0dc95a583 Adapt to new return type of tsstats.log.parse_logs 2016-11-19 22:27:44 +01:00
Thor77 fdbde18856 parse_logs: Return Server instead of dict
because it's easier to iterate and access contained information
2016-11-19 22:25:57 +01:00
Thor77 117dff2486 Use TemplateStream.dump for writing template
instead of manually opening a file and writing to it
2016-11-18 22:11:14 +01:00
Thor77 273a01bec6 Rename default template to stats.jinja2
from template.html
2016-11-18 21:52:30 +01:00
Thor77 9a38e0e7cb Rename template_path to template 2016-11-18 21:46:38 +01:00
Thor77 4bed26dac8 Move default template into new templates-subdir 2016-11-18 21:44:53 +01:00
Thor77 b8d2df4650 Load templates from templates-subdirectory
instead of package-root
2016-11-18 21:42:27 +01:00
Thor77 d522ce648a Add testcase for tsstats.utils.filter_threshold 2016-11-11 18:41:51 +01:00
Thor77 5637a11b2b Add onlinetimethreshold config and cli-option
to set render_template.onlinetime_threshold.
Default value is -1 => no filtering to not cause confusion
2016-11-11 18:40:52 +01:00
Thor77 4ac27143a6 Add onlinetime_threshold-arg to render_template
and filter_threshold-function to tsstats.utils.
Only display clients in onlinetime-section with a onlinetime
greater than onlinetime_threshold seconds
2016-11-11 18:40:30 +01:00
Thor77 414054c243 Link to section-list from section-heading 2016-11-10 21:57:30 +01:00
Thor77 15a437ea2c Bump hint.css-version to 2.4.1 2016-11-10 21:50:45 +01:00
Thor77 1ec0a37480 Add testcase for #3 (encoding issues) 2016-11-07 20:24:08 +01:00
Thor77 03c0941962 Add safety-measure to ensure clients disconnect at server stop 2016-11-06 19:23:00 +01:00
Thor77 c8955bee5e Remove double-iteratation over logfiles
by passing the iterator returned by glob.glob direclty to _bundle_logs
2016-11-06 19:18:21 +01:00
Thor77 679473f7b4 Use utcnow for creation_time
because utc timestamps are used in logs and for online_dc, too.
2016-11-04 20:05:02 +01:00
Thor77 812916f179 Use list-comprehension for reconnect
to make this action more obvious and understandable
2016-11-04 20:03:46 +01:00
Thor77 ba8e082e64 Reconnect clients only for last log (online_dc)
because doing it after every log would lead to insane onlinetimes
and only the last log should have online clients, anyways.

Fix #4
2016-11-03 22:52:05 +01:00
Thor77 7cd057d3c5 Write template-output as utf-8 2016-11-02 21:24:19 +01:00
Thor77 c0096a7c52 Read logs as utf-8 2016-11-02 21:24:07 +01:00
Thor77 37b8b7bc26 Bump hint.css-version to 2.4.0 2016-10-28 23:24:31 +02:00
Thor77 2d80ba6804 Add action-group to re_dis_connect.
Used to not rely on position in message
for correct action-parsing.
2016-10-27 00:08:28 +02:00
Thor77 b6e73e733d Fix adding server/clientgroup-actions to clients.
This was caused, because the used regex was very generic.
Therefore it parsed these lines without any problems,
a timestamp wasn't added but it was already in the clients-dict,
when these checks (conn or disconnect) were performed.
2016-10-27 00:02:56 +02:00
Thor77 80df2c02f0 Add testcase for logs with server/clientgroup-actions 2016-10-27 00:02:17 +02:00
Thor77 1b1ed86750 Add session-time on disconnect to debug-log 2016-10-04 15:21:05 +02:00
Thor77 040b451c7d Add timestamp for (dis)connect to debug-log 2016-10-04 15:18:08 +02:00
Thor77 f7669792c1 Set default for General.output to tsstats.html 2016-09-22 15:35:39 +02:00
Thor77 3a1d51a60b Remove default for output-flag
default still set through config-defaults, though
Providing a default here suppressed config-option "output"
2016-09-22 15:28:42 +02:00
Thor77 d1627d369f Add debug-logging-output to tsstats.template.render_template
* bump version to 0.11.1
2016-09-18 21:51:24 +02:00
Thor77 ddd220d629 Include datetime_fmt in funcdoc of tsstats.template.render_template 2016-09-17 22:49:05 +02:00
Thor77 799f622201 Use RawConfigParser instead of ConfigParser in tsstats.config
because General.datetimeformat creates problems with string-interpolation.
These are solved by swichting to RawConfigParser, which doesn't support this feature.
2016-09-17 22:42:32 +02:00
Thor77 52fc1b487c Add cli-flag for datetimeformat and pass config-option to funccall 2016-09-17 22:41:38 +02:00
Thor77 4078e4b06b Add config-option datetimeformat
for tsstats.template.render_template(datetime_fmt)
2016-09-17 22:41:03 +02:00
Thor77 1ecf24b9b2 Add datetime_fmt-arg to tsstats.template.render_template
Specify a custom datetime-format for various datetime-renderings (creation-time, last
online)
2016-09-17 22:38:30 +02:00
Thor77 5c52ab1995 Pass template config/cli-option to render_template in tsstats.__main__.main 2016-08-10 22:49:16 +02:00
Thor77 bbd2ff7a46 Add template_path-kwarg to tsstats.template.render_template 2016-08-10 22:47:19 +02:00
Thor77 604fefe286 Add 'template' config-option 2016-08-10 22:45:14 +02:00
Thor77 07b61d86ce Add -t/--template cli-arg 2016-08-10 22:44:48 +02:00
Thor77 3f140b8d6a Don't add sid-suffix to output if only one vserver occured in parsed logs
* bump version to 0.10.5
2016-08-09 20:37:20 +02:00
Thor77 a475caa7c7 Fix not calling str() on value before adding to config in __main__.cli
* bump version to 0.10.4
2016-08-08 22:25:57 +02:00
Thor77 5ff08e0163 Delay debugfile-creation to suppress needless creation if not in debugmode
* bump version to 0.10.3
2016-08-08 22:10:30 +02:00
Thor77 cfb593ba9c use py2-compatible way to check for section-existance in tsstats.config.load
* bump version to 0.10.2
2016-08-06 21:42:54 +02:00
Thor77 87f9bf43fc rewrite config-tests to work with new return-value of tsstats.config.load
* bump version to 0.10.1
2016-08-06 21:39:36 +02:00
Thor77 708f071033 replace tsstats.config.parse_config with tsstats.config.load, which just returns a configparser.ConfigParser-instance for easier extension
tsstats.__main__.main: now accepts only a configparser.ConfigParser-instance and extracts values from it
tsstats.__main__.cli: defaults from argparser are now suppressed and given cli-args override values from config

* bump version to 0.10.0
2016-08-06 21:36:17 +02:00
Thor77 2a1ab472bb update bootstrap and hint.css version
* bump version to 0.9.1
2016-08-03 22:02:56 +02:00
Thor77 67c08330d8 reduce size of section-headers (h1 -> h2) 2016-07-04 21:17:34 +02:00
Thor77 402040e2dc add title (configurable) as headline to template 2016-07-04 21:16:58 +02:00
Thor77 60bdcb7aab add credit and render-date/time to template-footer 2016-07-04 21:14:29 +02:00
Thor77 477ca7d739 add timezone to output of tsstats.template.render_template.frmttime 2016-07-04 21:11:34 +02:00
Thor77 34e682cf81 remove unused var-assignment in __main__.cli 2016-06-25 20:42:50 +02:00
Thor77 bb808ca8c0 rename noonlinedc to onlinedc in __main__.main to correctly represent it's function
* rename noonlinedc to onlinedc in value-dict returned by .parse_args
* rename keyword-arg from noonlinedc to onlinedc in __main__.main
2016-06-25 20:42:50 +02:00
Thor77 892680fe4d add onlinedc config-option
* inverse of --noonlinedc
2016-06-25 20:42:46 +02:00
Thor77 573838c35e Merge branch 'multi_vserver' 2016-06-24 21:43:51 +02:00
Thor77 487a50508f add -nod/--noonlinedc cli-flag 2016-06-23 21:43:40 +02:00
Thor77 95c22dde35 make __main__.main work with new output of tsstats.log.parse_logs
* if sid given, add .<sid> to outputpath
2016-06-22 20:47:12 +02:00
Thor77 eafc98f548 add test for tsstats.log.parse_logs 2016-06-22 20:40:55 +02:00
Thor77 0b667f55b7 check for None instead of False to allow empty clients as arg to tsstats.log._parse_details 2016-06-22 20:40:30 +02:00
Thor77 def9f2e1e2 fix logpath not given to _bundle_logs in tsstats.log.parse_logs 2016-06-21 22:16:39 +02:00
Thor77 21be54675f add proper func-doc to tsstats.log.parse_logs 2016-06-21 18:29:59 +02:00
Thor77 54532fd598 use _bundle_logs in template-tests for now 2016-06-21 18:25:38 +02:00
Thor77 468bfcd22d fix log-tests by renaming all occurences of parse_log to _parse_details
* additionally remove deprecated test_multiple-test
2016-06-21 18:23:35 +02:00
Thor77 c132c17661 add ident_map-arg to tsstats.log.parse_logs
* give all given arguments to tsstats.log._bundle_logs while parsing (*args,
**kwargs)
2016-06-21 18:20:57 +02:00
Thor77 c0f1a6c649 add glob-resolution to tsstats.log.parse_logs
* correct name of bundle-function (to tsstats.log._bundle_logs)
* add .items() to correct for-loop
2016-06-20 22:02:55 +02:00
Thor77 9a6bbe4f3e fix 2 typos in tsstats.log._bundle_logs 2016-06-20 21:59:46 +02:00
Thor77 976d40e2b9 add test for tsstats.log._bundle_logs 2016-06-20 21:59:22 +02:00
Thor77 105f464b9a sort logs by path, if timestamp not available, though 2016-06-20 21:38:57 +02:00
Thor77 e92ad9e6fe update scope of tsstats.log._sort_logs (rename to tsstats.log._bundle_logs)
* rename to tsstats.log._bundle_logs
* expect list of logpaths as argument and return them sorted
* move globbing-stuff to parse_logs in an upcoming commit
2016-06-20 21:31:59 +02:00
Thor77 612055a088 add wip tsstats.log.parse_logs 2016-06-19 22:26:19 +02:00
Thor77 0c57b27abc update documentation of tsstats.log._sort_logfiles to fit updated scope 2016-06-19 22:21:02 +02:00
Thor77 37a9841900 rename tsstats.log.parse_logs to tsstats.log._sort_logfiles to fit updated scope 2016-06-19 22:13:05 +02:00
Thor77 ad7ff96b1b add filename-checking to split logs by sid
* if filename doesn't match, fallback to plain sorting
* using re_log_filename to match
2016-06-19 22:10:35 +02:00
Thor77 bec0279871 rename tsstats.log.parse_log to tsstats.log._parse_details 2016-06-19 21:44:23 +02:00
Thor77 2821713150 redefine scope of tsstats.log.* in func-docs 2016-06-19 21:37:00 +02:00
Thor77 8abb0029fa cover line not matching 2016-06-12 18:44:41 +02:00
Thor77 850d3463ce remove unneccessary and unused tsstats.client.Client.__getitem__ 2016-06-12 18:43:20 +02:00
Thor77 123370554a use defined output_path in tsstats.tests.test_template.output-fixture and sort imports 2016-06-12 18:39:56 +02:00
Thor77 95c516a9f3 make tsstats.tests.test_template.test_online compatible with datetime.timedelta as Client.onlinetime 2016-06-12 18:36:09 +02:00
Thor77 12a86539d2 convert onlinetime to int before converting to text
* => don't display milliseconds in text
2016-06-12 18:11:27 +02:00
Thor77 e3df7f8185 template-filter frmttime just returns formatted timestamp now
* instead of converting it to localtime before
2016-06-12 18:02:47 +02:00
Thor77 2ed3b7f48d make tsstats.tests.test_log compatible with datetime.timedelta as Client.onlinetime 2016-06-12 17:55:52 +02:00
Thor77 32234b4886 rename template-filter fmttime to frmttime 2016-06-12 17:55:03 +02:00
Thor77 c3dabb9082 give .total_seconds() to sort_clients instead of datetime.timedelta 2016-06-12 17:54:32 +02:00
Thor77 28855e9a81 use datetime.timedelta for Client.onlinetime instead of int
* get rid of all the converting-stuff
2016-06-12 17:52:44 +02:00
Thor77 89906d04c7 expect key as lambda in tsstats.utils.sort_clients
* kwarg renamed to key_l (from key)
* add possibility to modify attribute
2016-06-12 17:36:12 +02:00
Thor77 9d5197d813 use py2-compatible way to convert datetime.datetime to timestamp
* bump version to 0.6.8
2016-06-12 17:20:32 +02:00
Thor77 276dce0074 give all *args and **kwargs given to tsstats.log.parse_logs directly to parse_log 2016-06-12 17:01:35 +02:00
Thor77 17d7552e8b set parse_log(online_dc=False) in all log-tests 2016-06-12 16:58:17 +02:00
Thor77 4e4eacd3af disconnect online clients after parsing to display correct onlinetime
* toggle by setting tsstats.log(online_dc=)
* fix #1
2016-06-12 16:54:49 +02:00
Thor77 a1c5f67c0c extract path to testlog into variable 2016-06-12 16:39:41 +02:00
Thor77 3972594787 add testcase for #1 2016-06-12 16:38:28 +02:00
Thor77 be361e976c sort imports in tsstats/client.py 2016-06-10 16:48:49 +02:00
Thor77 fde3a921f9 refactor tsstats.tests.test_template.test_onlinetime
* check client-count in template
* take clients as base instead for comparisons
* dynamically check all included client-objects
TODO
====
* move nick_data-dict-generation into function or fixture
* split tsstats.client.Clients into id and uuid-clients to easily compare client- and template-data
2016-06-10 16:46:55 +02:00
Thor77 3e5c79fc05 add test for right identifier in debug-mode 2016-06-10 16:22:52 +02:00
Thor77 5d2e3e00a3 add id to sections and use unique id for client-items 2016-06-10 16:04:24 +02:00
Thor77 4ddc6bbf41 refactor tsstats.tests.test_template.test_data
* rename to test_onlinetime
* add soup-fixture (renders template + returns BeautifulSoup-instance)
2016-06-10 15:36:32 +02:00
Thor77 4acfe5bd0b fix references to identmap-doc from tsstats.client and tsstats.log
* use :doc: instead of :ref:
* bump version to 0.6.5
2016-06-08 22:36:26 +02:00
Thor77 ea5d997b5a update bootstrap and hint.css in tsstats/template.html
* bump version to 0.6.2
* fix insecure-content warnings
2016-06-07 18:26:47 +02:00
Thor77 fe29b6f050 refactor template-loading
* use ChoiceLoader([PackageLoader, FileSystemLoader]) instead of FileSystemLoader
* add PackageLoader to allow template-access on egg-installations
* use correct way to get filesystem-path to package (dirname(__file__))
* remove superflous template_name-arg from tsstats.template.render_template
* bump version to 0.6.0
2016-06-07 17:51:28 +02:00
Thor77 52a05acdab add source-encoding (utf-8) to all files 2016-06-07 17:42:53 +02:00
Thor77 c3cfad0a88 fix wrong regex for logs with unexpected spacing
* add "\ *" arround level, component, sid and message
2016-06-07 16:51:55 +02:00
Thor77 8ca23e0115 add documentation to tsstats.{config,log,template,utils}.* 2016-05-30 20:23:03 +02:00
Thor77 f7af9f9d39 add documentation for tsstats.exceptions.* 2016-05-29 00:25:21 +02:00
Thor77 752e4f4c82 rename tsstats.exceptions.InvalidConfig to InvalidConfiguration
because there's no seperation between config and cli-values
2016-05-25 20:14:59 +02:00
Thor77 7186cd662b remove obsolete tsstats.exceptions.ConfigNotFound 2016-05-25 20:13:38 +02:00
Thor77 a1f25648a2 define log_format just once and rename to log_timestamp_format 2016-05-25 20:09:48 +02:00
Thor77 09ad45e9a6 cover tsstats.log.parse_logs 2016-05-25 20:06:17 +02:00
Thor77 da5683ede2 add tsstats.log.re_log_entry for log-line-matching
* don't evaluate invalid log-lines leading to unexpected results
* don't abort parsing just because of an invalid character at the beginning/end
* add debug-output if line doesn't match
2016-05-25 20:06:00 +02:00
Thor77 42d8c74f72 fix tsstats.log.parse_logs not returning clients 2016-05-24 22:29:49 +02:00
Thor77 53ffad3d81 refactor tsstats.log.parse_log(s)
* rename tsstats.log.parse_logs to tsstats.log.parse_log and remove glob-functionality
* create tsstats.log.parse_log to handle globbing
* fix tests to use tsstats.log.parse_log instead of tsstats.log.parse_logs
* bump version to 0.4.0
2016-05-23 21:50:10 +02:00
Thor77 eb9d26cc1e duplicate debug-enable to get debug-output from parse_config 2016-05-21 23:15:15 +02:00
Thor77 c094edb6e9 refactor config.parse_config
* add debug-output
* return config-values as expected by __main__.main
* remove test_config_invalid
* fix tests
2016-05-21 23:14:52 +02:00
Thor77 ec62d4f439 refactor __main__.cli and __main__.main
* __main__.cli is now just used to setup argparse and pass arguments to __main__.main
* __main__.main is now used to validate the arguments and pass them to the right functions
2016-05-21 22:51:05 +02:00
Thor77 23145b476b remove cli-defaults for config and idmap 2016-05-21 22:06:32 +02:00
Thor77 b80be2b1c5 add short option-flags to cli 2016-05-21 22:03:26 +02:00
Thor77 2b9e9d0911 add log and output cli-args 2016-05-21 21:35:42 +02:00
Thor77 af3ea48a2d re-add redundant client.nick= in tsstats.log.parse_logs to display nick-changes 2016-05-19 21:59:34 +02:00
Thor77 4bb7553f64 remove duplicate code in tsstats.log.parse_logs
* bump version to 0.2.4
2016-05-19 21:57:15 +02:00
Thor77 61421c588a use None as default for ident_map in tsstats.log.parse_logs 2016-05-19 21:46:22 +02:00
Thor77 abea9c0f89 remove test_general.py (testing __main__) to get clear coverage-results 2016-05-19 21:40:37 +02:00
Thor77 3112311f7e move invalid-log-test from test_general.py to test_log.py 2016-05-19 21:37:12 +02:00
Thor77 3f2ccd3ac6 cover tsstats.client.Clients.__del__ 2016-05-19 21:24:22 +02:00
Thor77 8af2b761a3 refactor tsstats.client.Client.__getitem__ 2016-05-19 21:09:27 +02:00
Thor77 3729ecf9c0 add tests for Clients-getter 2016-05-19 15:47:04 +02:00
Thor77 d9f46e1b33 test refactored tsstats.client.Clients correctly in test_ident_map.py 2016-05-19 15:47:01 +02:00
Thor77 36790e3863 modify test_log_client_count to use tsstats.client.Clients.__len__ 2016-05-19 15:41:19 +02:00
Thor77 cb6d433dca add usage of ident_map for tsstats.client.Clients.__setitem__ 2016-05-19 15:40:28 +02:00
Thor77 55277a2c75 use optional-nick-arg instead of explicit assignment 2016-05-19 15:39:36 +02:00
Thor77 cb94560a2f add optional nick-arg to tsstats.client.Client.__init__ 2016-05-19 15:24:18 +02:00
Thor77 c9895c6c5a allow legacy tsstats.client.Client += 2016-05-19 15:23:11 +02:00
Thor77 ac305b3873 reimplement usage of IdentMap 2016-05-19 15:22:16 +02:00
Thor77 216bedc38f refactor tsstats.client.Clients
* use collections.MutableMapping as base
* use one dict to store all types of Clients
* don't use implicit += but explicit .setdefault in tsstats.log for client-adding
* give all clients to sort_clients in tsstats.template
* remove now unneccessary clients-assignment in tsstats.utils.sort_clients
2016-05-18 22:50:23 +02:00
Thor77 a7cfa6967f split client and parse-tests into test_client.py and test_log.py 2016-05-18 22:08:09 +02:00
Thor77 0990644128 add documentation to tsstats.client.Client and tsstats.client.Clients 2016-05-18 21:27:18 +02:00