Store stats information into separate files
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 21 Sep 2010 11:33:42 +0000 (13:33 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 22 Sep 2010 09:20:57 +0000 (11:20 +0200)
commit14c3f6e51b2830f7bcaa595f9ce1838d1b963826
tree830c061f3c16c34362ff7ccf683ac6a0f494dafb
parent6fa702170e9420139b047a8817ee978f6fcbd916
Store stats information into separate files

Currently the statistic information is stored into the profile file.
This results in rewriting the whole file if connann_stats_save is
called. This results in too many disk I/Os for low power devices.

Furthermore, only the current value is stored. There is no way to
find out how many bytes have been transfered in the last month.

First, each service statistic is stored into a separate files under
/var/lib/connman having a *.data extension. This file contains fixed
sized records of stats counters and will be mmap into memory. It is
used like a ring buffer.

If the buffer is full or after a certain period (e.g. a month), the
raw data will be summerized into the *.info file.
Currently the summary is not implented yet. This will be implemented
in the next round of patches.
Makefile.am
configure.ac
src/connman.h
src/main.c
src/service.c
src/stats.c [new file with mode: 0644]