summaryrefslogtreecommitdiffabout
path: root/src/stat.c
AgeCommit message (Collapse)AuthorFiles
2009-04-28Store timestamps. Implement zero-unknown option.Sergey Poznyakoff1
* src/graph.c (draw_graph): Use timestamps from queue entries. Implement zero_unknown_option. * src/output.c: Store timestamps in traffic_history entries. * src/readconfig.c (cb_monitor, cb_server): Fix checks for empty ID. (tagr_kw): New keyword cut-out-fraction. (readconfig): Reset cut_out_fraction if it is < 1.0. * src/report.c: Print timestamps. * src/stat.c (cut_out_fraction): New variable. (ovf_t, overflow): Remove (spurious now) arguments. (interpolate, overflow, update_stats): Don't interpolate if time interval between this sample and the lastly taken one is greater than step * cut_out_fraction. * src/tagr.h (TAGR_CUT_OUT): New define.
2009-04-27Bugfixes.Sergey Poznyakoff1
* src/main.c (change_user): Bugfix (main): Reset user to the value of user_option, if set. Fix (again) log_to_stderr initialization. Switch to user privileges before actually performing any actions that modify the database and other output files. * src/report.c (open_db): Don't exit if unable to open database. Return 1 instead. All callers updated. * src/tagr.h (open_db): Update prototype.
2009-04-26Provide i18n markersSergey Poznyakoff1
2009-04-25Improve graphical presentation. Other bugfixes.Sergey Poznyakoff1
* src/graph.c (draw_graph): Cut off values of Y greater than YMAX Use scale_sample to prepare data. * src/grid.c (ygrid_create): New function. (ygrid_next): Use data prepared by ygrid_create. * src/main.c (change_user): Bugfix. Update calls to open_db Move log initialization to the proper place. * src/output.c (scale_sample): New function. (add_stats): Use scale_sample to prepare data. (cb_monitor): Initialize scale and ystep. (cb_double): New function. (monitor_kw): New keywords: scale, y-step and swap. * src/report.c (open_db): Take an argument specifying whether the database will be written to. All callers updated. * src/tagr.h (struct monitor): New members: scale, ystep and swap. max_rate is ulong. (TAGR_DB_RD, TAGR_DB_WR): New macros. (open_db): Update proto. (scale_sample): New proto.
2009-04-25Normalize terminology.Sergey Poznyakoff1
* etc/upgrade.awk: Translate "router" to "monitor". Divide max rate by 8. * src/graph.c (rate_unit): New global. (draw_graph): Take monitor as an argument. Make rate units configurable. * src/readconfig.c (find_router, find_router_id): Rename to find_monitor, find_monitor_id. Rename "router" section to "monitor". New statement "rate-units", allowed both at top level and within a monitor. * src/tagr.h (HostData): Rename to monitor. Add new field: rate_unit. Rename `max' to `max_rate'. Remove t, in, out. (rate_unit): New declaration. (find_router, find_router_id): Rename to find_monitor, find_monitor_id. (struct last_sample): Rename to struct traffic_sample. * src/output.c, src/report.c, src/stat.c: Update
2009-04-24Switch to GPLv3+Sergey Poznyakoff1
2009-04-24Fix statistics gathering algorithm. Start implementing drawing functions.Sergey Poznyakoff1
* src/output.c: New file. * src/Makefile.am (tagr_SOURCES): Add output.c * src/graph.c (draw_graph): New function. * src/main.c (mkfilename): Allow for suffix=NULL * src/report.c (tr_init): Set queue sizes to exactly the number of the corresponding samples. (update_output): New function. (rebuild): Implement * src/stat.c (interpolate): Avoid interpolation if time span is less than the step. Use queue_put to store the data and always call the overflow procedure, if supplied. (overflow): Fix condition. (compute_avg): New function. (ovf_monthly, ovf_weekly, ovf_daily): Add verbose diagnostics. (_convert): Additional argument: overflow function. (convert_yearly, convert_monthly, convert_weekly): Compute the average. Add verbose diagnostics. (convert_daily): Add verbose diagnostics. * src/tagr.h (update_output, draw_graph): New protos.
2009-04-21Use "grecs" submodule for configuration parsing.Sergey Poznyakoff1
* Makefile.am (ACLOCAL_AMFLAGS): Add -I grecs/am. (SUBDIRS): grecs (ChangeLog): New rule. * ChangeLog: Rename to ChangeLog.svn * doc: Rename to etc. * etc/upgrade.awk: New file. * bootstrap.conf: Initialize "grecs". * configure.ac: Call GRECS_SETUP. (AC_CONFIG_FILES): Add grecs/Makefile and grecs/src/Makefile. * gnulib.modules: Add gitlog-to-changelog and sysexits. * src/Makefile.am (LDADD, INCLUDES): Add grecs. (AM_CPPFLAGS): Define additional variables. * src/log.c (use_stderr): Remove. Use log_to_stderr instead. (grecs_print_diag): New function. * src/main.c: Redo command-line support. (listen_sockaddr): New global. * src/readconfig.c: Rewrite. * src/tagr.h: Include sysexits.h and grecs.h (listen_sockaddr, log_to_stderr, pidfile): New externs. * src/main.c, src/stat.c, src/report.c: Use sysexits codes.
2008-07-11Reorganize project directory layout.Sergey Poznyakoff1
* README-hacking: New file. * src: New directory * src/Makefile.am: New file. * graph.c, readconfig.c, tagr.h, log.c, report.h, queue.c: Move to src * main.c: Move to src, fix a minor bug in main. * html.l: Move to src/html.lex.l. * html.y: Move to src/html.gram.y. * lib/argcv.c, lib/argcv.h: Move to src. * config, INSTALL: Remove * README_hacking: New file. * configure.ac, Makefile.am: Update for new gnulib and new directory structure. * bootstrap: Update from gnulib. * gnulib.modules: New file. * bootstrap.conf: New file. git-svn-id: file:///svnroot/tagr/trunk@89 7c378d0d-a4e4-4a64-9229-dfce8bfd23d4

Return to:

Send suggestions and report system problems to the System administrator.