-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathalgorithm.txt
29 lines (27 loc) · 1.61 KB
/
algorithm.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
measurement cycles:
- STATISTICS_INTERVAL (ms)
- MEASUREMENT_INTERVAL (ms)
STATISTICS_INTERVAL
- Summary: gather (method) activity
- for all running threads, from top / newest of stacktrace
- first element rated as computation time of 1 STATISTICS_INTERVAL / MEASUREMENT_INTERVAL
- for prefixed report:
- first element which matches at least one prefix rated as computation time of 1 STATISTICS_INTERVAL / MEASUREMENT_INTERVAL
- increment METHOD_ACTIVITY accordingly
MEASUREMENT_INTERVAL
- summary
- gather power consumption
- aggregate method activity and power consumption to energy consumption per method
- POWER_TOTAL (W) - get current CPU power per MEASUREMENT_INTERVAL
- call e.g. Libre Hardware Monitor for current CPU power usage
- assume power was the same for the entirety of MEASUREMENT_INTERVAL
- get CPU times
- THREAD_TIME (ns) - total CPU time of each running threads -> should time since last measurement?
- APPLICATION_TIME (ns) - total CPU time of all running threads -> should be sum of should time since last measurement?
- computation -> as separate task?
- allocate power usage to threads per MEASUREMENT_INTERVAL
- POWER_THREAD (W) = POWER_TOTAL * (THREAD_TIME / APPLICATION_TIME)
- determine power usage of each method per MEASUREMENT_INTERVAL
- POWER_METHOD (W) = POWER_THREAD * (METHOD_ACTIVITY * STATISTICS_INTERVAL / MEASUREMENT_INTERVAL) -> currently fix ration of 1 / 100
- determine energy usage of each method in MEASUREMENT_INTERVAL (current assumption: MEASUREMENT_INTERVAL always 1000ms, so W = J)
- ENERGY_METHOD (J) = POWER_METHOD * MEASUREMENT_INTERVAL / 1000