tizen 2.3.1 release
[kernel/api/system-resource.git] / docs / traffic_db.txt
1 Table of context
2 ---------------
3
4 1. ERD - Entity relation diagram
5 2. Statistics entity
6 3. Restrictions entity
7 4. Quotas entity
8 5. Effective quota entity
9
10
11 1. ERD
12
13    +----------------------------+     +--------------------+    +-------------+
14    |         restrictions       |     |    statistics      |    |     quotas  |
15    |----------------------------|     |--------------------|    |-------------|
16    |binpath: TEXT               |<--->|binpath: TEXT       |<-->|binpath      |
17    |cpu: INT                    |  |  |received: BIGINT    |    |sent_quota   |
18    |mem: INT                    |  |  |sent: BIGINT        |    |rcv_quota    |
19    |incomming_rate: INT         |  |  |time_stamp: BIGINT  |    |time_period  |
20    |outgoing_rate: INT          |  |  |ifname: TEXT        |    |start_time   |
21    |                            |  |  |ifmac: TEXT         |    +-------------+
22    |                            |  |  |                    |
23    |                            |  |  |                    |
24    +----------------------------+  |  +--------------------+
25                                    |
26                                    |
27                                    |  +---------------------------+
28                                    |  |   effective_quota         |
29                                    |  |---------------------------|
30                                    +->|binpath                    |
31                                       |sent_used_quota            |
32                                       |rcv_used_quota             |
33                                       |start_time                 |
34                                       |finish_time                |
35                                       |                           |
36                                       +---------------------------+
37
38 2. Statistics entity
39 --------------------
40 Holds information about counted traffic per time points, time_stamp - it's time
41 point. Accumulation of the information proceses in main loop of perf-controld.
42
43
44 3. Restrictions entity
45 ----------------------
46 Holds information about restriction see set_restriction function. Every time we
47 set restriction we store it in the database, it give us an ability to apply
48 restriction for example after reboot.
49 TODO: Possible bug. We don't separate quota based restriction and user based.
50 User based restriction should be applied without conditions, quota based should
51 be checked is quota active.
52
53
54 4. Quotas entity
55 ----------------
56 Holds information about quota.
57
58
59 5. Effective quota entity
60 -------------------------
61 Holds information about active quota. One enty per quotas time interval.
62
63
64      | time period | time period | time period |
65 ------------------------------------------------------------------------------>
66      ^             ^             ^
67      start time    finish time   finish time
68                    start time    start time
69 time line