attempting to rename the proj. uno momento.
[cpuHistory.git] / CPUMon.taskpaper
blob6fc8705f50f6a20fe2ab5d57ad8b6660b540996c
1 CPU Mon:
2 - change app name to CPU Mon
3 - change preferences file, all other applicable info.
4 - test prefs: change in Memory Monitor, see if app picks them up
5 - remove extraneous information for memory monitor:
6         - preferences form
7 - future upgrades:
8         - CPU usage across processors:
9                 - get # of processors with http://www.cocoadev.com/index.pl?NSProcessInfo
10                 - add another graph or average across both cores?
12         int size = 24, i, j;
13         CPUInfo *cpuInfo = [[CPUInfo alloc] initWithCapacity:size];
14         CPUData cpuData;
15         
16         [cpuInfo refresh];
17         for (j = 0; j < 48; j++) {
18                 for (i = 0; i < 1000000; ) {
19                         i++;
20                 }
21                 [cpuInfo refresh];
22         }
24         [cpuInfo startIterate];
25         for (i = 0; [cpuInfo getNext:&cpuData]; i++) {
26                 NSLog(@"user: %e\n", cpuData.user);
27                 NSLog(@"sys: %e\n", cpuData.sys);
28                 NSLog(@"nice: %e\n", cpuData.nice);
29                 NSLog(@"idle: %e\n", cpuData.idle);
30         }
31         
32         return 0;
35 key:
36 - wired = user
37 - active = sys
38 - inactive = nice
39 - free = idle
42 Archive:
43 - get it to build @done @project(CPU Mon)
44 - make another pass through the source to take out extraneous references to CPUUsage @done @project(CPU Mon)
45 - check TODOs @done @project(CPU Mon)
46 - how to do data update: make a large float array with my usage data in it, use a rolling pointer to update things. store new data from current cpu stats. @done @project(CPU Mon)
47         - is that how the current and last stuff is built? @done @project(CPU Mon)
48 - in other words, I need to pass the pointer by reference so I can modify its value (ie the memory it points to). keep in mind, someone has to clean up after the old memory. @done @project(CPU Mon)
49 - memory leak: vm_deallocate the processorInfo array after use: @done @project(CPU Mon)
50 - methods needed: @done @project(CPU Mon)
51         - updateCPUStat: what do we want to accomplish here? @done @project(CPU Mon)
52                 - get current data @done @project(CPU Mon)
53                 - retrieve data at last refresh @done @project(CPU Mon)
54                 - subtract last from current @done @project(CPU Mon)
55         - init: init the processor usage data: set the first "lastProcessorInfo" array so update is all good to go. @done @project(CPU Mon)
56         - getCurrentData @done @project(CPU Mon)
57                 - return last data @done @project(CPU Mon)
58         - getNext: @done @project(CPU Mon)
59                 - run update @done @project(CPU Mon)
60                 - set ptr new data @done @project(CPU Mon)
61                 - update internal ptrs @done @project(CPU Mon)
62         - getPrev @done @project(CPU Mon)
63                 - return one before last? @done @project(CPU Mon)
64 - variables needed: @done @project(CPU Mon)
65         - CPUData array @done @project(CPU Mon)
66         - lastProcessorInfo (for diffs) @done @project(CPU Mon)
67         - numLastProcessorInfo (to deallocate it) @done @project(CPU Mon)
68         - two variables to track size, location in array @done @project(CPU Mon)
69 - notes: need TWO refreshes at init to get current info! @done @project(CPU Mon)
70                 if(lastProcessorInfo) {
71                         size_t lastProcessorInfoSize = sizeof(integer_t) * numLastProcessorInfo;
72                         vm_deallocate(target_task, (vm_address_t)lastProcessorInfo, lastProcessorInfoSize);
73                 }
75                 lastProcessorInfo = processorInfo;
76                 numLastProcessorInfo = numProcessorInfo;
77         - first test data coming out of cpu info with logs (this might hurt. limit to one sample every 2 sec) @done @project(CPU Mon)
78         - test with xcode debugger to watch array data change. @done @project(CPU Mon)
79         - paging rate graph @done @project(CPU Mon)
80 - switch the source of the graph from memory info to CPU info: @done @project(CPU Mon)
81         - then change graphing fct to pull from different data source @done @project(CPU Mon)
82         - text overlay @done @project(CPU Mon)