summaryrefslogtreecommitdiff
path: root/src/stats.c
AgeCommit message (Collapse)AuthorFilesLines
2019-09-18Imported Upstream version 1.37submit/tizen/20190920.082459Nishant Chaprana1-4/+3
Change-Id: Idb47c1ddbedc9f97181b8e9a5eeac04ddd832a2c Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2019-07-04Imported Upstream version 1.37upstream/1.37Nishant Chaprana1-4/+3
Change-Id: Ib5957e7ee3a9315ee86a331189bc3e9e71751ee8 Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2018-01-23Updated connman to version 1.35Seonah Moon1-24/+26
Change-Id: I13526fbf80296a79be15548fc226a308941ac9ec Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
2018-01-08Imported Upstream version 1.35upstream/1.35Seonah Moon1-24/+26
Change-Id: I174854914d9fd06a813270b57d1f7bc2bac63c6a Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
2015-08-07Base Code merged to SPIN 2.4submit/tizen/20150810.034432hyunuktak1-0/+0
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com> Change-Id: I84a42375b5c59739e4caca1f726699ea7647ef17
2014-10-29Imported Upstream version 1.26upstream/1.26Zhang zhengguang1-1/+1
2014-07-17Imported Upstream version 1.24upstream/1.24Zhang zhengguang1-30/+30
2011-10-25core: Add O_CLOEXEC to open()Daniel Wagner1-1/+1
Make sure all file descriptor are closed.
2011-09-12stats: Move stat files to respective service identifier directoryAlok Barsode1-4/+25
2011-06-16element: Remove element.cDaniel Wagner1-0/+1
2011-03-04stats: Fix compiler warning on 64-bit machinesMarcel Holtmann1-1/+1
2011-03-04stats: Add an informational message for mmap failuresGrant Erickson1-3/+9
Added an informational message when mmap fails with EINVAL in stats_file_remap.
2011-03-04stats: Avoid double-frees on a failed mappingGrant Erickson1-2/+16
Added debugging statements and ensure, following calls to g_free, that the statistics file name field is set to NULL to ensure that a failed file mapping and a subsequent call to stats_free doesn't fault when trying to double-free it.
2011-02-03stats: Add comment about MAP_SHAREDDaniel Wagner1-0/+6
Clarify why MAP_SHARED is used instead of the obvious MAP_PRIVATE.
2011-01-31stats: Fix double free errorGrant Erickson1-3/+11
The error appears when stats_file_remap() fails.
2010-12-10stats: Sum stats ring buffer up info history fileDaniel Wagner1-44/+358
When the ring buffer (SERVICE_NAME.data file) is full then it is summarized into a history (SERVICE_NAME.history) file. The history file has the same format as the data file.
2010-10-13Merge stats_create into __connman_stats_service_registerDaniel Wagner1-18/+4
This avoid doing an hash table lookup from __connman_stats_service_register() right after inserting the stats_file pointer into it.
2010-10-13Merge home and roaming stats fileDaniel Wagner1-84/+107
Instead creating for each service two stats file (home and roaming), just create one. Each entry in the file is marked with a flag (home or roaming). The file header contains two additional index which points to the current home or roaming entry. Now we have a nice history in the ring buffer. Additionally this reduces the number of open files by half.
2010-10-11Open stats file late and close them earlyDaniel Wagner1-0/+2
Instead of opening stats file when a service is created, defer it to the point where either __connman_ipconfig_enable or __connman_ipconfig_disable is called.
2010-10-11Initialize struct stat in error case correctlyDaniel Wagner1-0/+1
In the case stat failes to gather information about the log file, it has to initialize struct stat. Otherwise, we will set a random file size.
2010-09-23Fix "invalid file header"Daniel Wagner1-9/+21
Use stat before open the file to find out if the file already exists. Only if file exists and the header is invalid trigger connman_error
2010-09-23Put .data files into a separate directoryDaniel Wagner1-2/+2
2010-09-22Store stats information into separate filesDaniel Wagner1-0/+431
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.