Lines Matching refs:self

10     def __init__(self, activity):  argument
11 self.uid = activity['uid']
12 self.foregroundWrittenBytes = activity['foregroundWrittenBytes']
13 self.foregroundFsyncCalls = activity['foregroundFsyncCalls']
14 self.backgroundFsyncCalls = activity['backgroundFsyncCalls']
15 self.backgroundWrittenBytes = activity['backgroundWrittenBytes']
16 self.appPackages = activity['appPackages']
17 self.runtimeMs = activity['runtimeMs']
18 self.totalWrittenBytes = self.foregroundWrittenBytes + self.backgroundWrittenBytes
19 self.totalFsyncCalls = self.backgroundFsyncCalls + self.foregroundFsyncCalls
20 if self.appPackages is None: self.appPackages = []
23 def __init__(self, activity, uptime): argument
24 self.uptime = uptime
25 self.uids = {}
26 self.foregroundWrittenBytes = 0
27 self.foregroundFsyncCalls = 0
28 self.backgroundFsyncCalls = 0
29 self.backgroundWrittenBytes = 0
30 self.totalWrittenBytes = 0
31 self.totalFsyncCalls = 0
35 self.foregroundWrittenBytes += snapshot.foregroundWrittenBytes
36 self.foregroundFsyncCalls += snapshot.foregroundFsyncCalls
37 self.backgroundFsyncCalls += snapshot.backgroundFsyncCalls
38 self.backgroundWrittenBytes += snapshot.backgroundWrittenBytes
39 self.totalWrittenBytes += snapshot.totalWrittenBytes
40 self.totalFsyncCalls += snapshot.totalFsyncCalls
41 self.uids[uid] = snapshot
44 def __init__(self, f): argument
45 self.snapshots = []
54 self.snapshots.append(Snapshot(activity, uptime))
55 self.runtime = datetime.timedelta(milliseconds=uptimes[1]-uptimes[0])
99 def __init__(self, uid): argument
100 self.uid = uid
101 self.snapshots = []
102 self.appPackages = wellKnownUids.get(uid, [])
103 self.foregroundWrittenBytes = 0
104 self.foregroundFsyncCalls = 0
105 self.backgroundFsyncCalls = 0
106 self.backgroundWrittenBytes = 0
107 self.totalWrittenBytes = 0
108 self.totalFsyncCalls = 0
110 def addSnapshot(self, snapshot): argument
111 assert snapshot.uid == self.uid
112 self.snapshots.append(snapshot)
113 self.foregroundWrittenBytes += snapshot.foregroundWrittenBytes
114 self.foregroundFsyncCalls += snapshot.foregroundFsyncCalls
115 self.backgroundFsyncCalls += snapshot.backgroundFsyncCalls
116 self.backgroundWrittenBytes += snapshot.backgroundWrittenBytes
117 self.totalWrittenBytes += snapshot.totalWrittenBytes
118 self.totalFsyncCalls += snapshot.totalFsyncCalls
119 self.appPackages = merge(self.appPackages, snapshot.appPackages)
121 def plot(self, foreground=True, background=True, total=True): argument
123 plt.title("I/O activity for UID %s" % (self.uid))
124 X = range(0,len(self.snapshots))
128 Y = [s.foregroundWrittenBytes for s in self.snapshots]
134 Y = [s.backgroundWrittenBytes for s in self.snapshots]
140 Y = [s.totalWrittenBytes for s in self.snapshots]
154 def __init__(self): argument
155 self.uids = {}
156 self.snapshots = []
157 self.foregroundWrittenBytes = 0
158 self.foregroundFsyncCalls = 0
159 self.backgroundFsyncCalls = 0
160 self.backgroundWrittenBytes = 0
161 self.totalWrittenBytes = 0
162 self.totalFsyncCalls = 0
164 def addSnapshot(self, snapshot): argument
165 self.snapshots.append(snapshot)
166 self.foregroundWrittenBytes += snapshot.foregroundWrittenBytes
167 self.foregroundFsyncCalls += snapshot.foregroundFsyncCalls
168 self.backgroundFsyncCalls += snapshot.backgroundFsyncCalls
169 self.backgroundWrittenBytes += snapshot.backgroundWrittenBytes
170 self.totalWrittenBytes += snapshot.totalWrittenBytes
171 self.totalFsyncCalls += snapshot.totalFsyncCalls
173 if uid not in self.uids: self.uids[uid] = UserActivity(uid)
174 self.uids[uid].addSnapshot(snapshot.uids[uid])
176 def loadDocument(self, doc): argument
178 self.addSnapshot(snapshot)
180 def sorted(self, f): argument
181 return sorted(self.uids.values(), key=f, reverse=True)
183 def pie(self): argument
186 A = [(K, self.uids[K].totalWrittenBytes) for K in self.uids]
202 def __call__(self, uid): argument
206 def __call__(self, uid): argument
210 def __init__(self, uids): argument
211 self.uids = uids
213 def __call__(self, uid): argument
214 return uid in self.uids