Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: tools/telemetry/telemetry/core/timeline/process.py

Issue 332213003: Move telemetry/core/timeline and timeline_data to telemetry/timeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/core/timeline/process.py
diff --git a/tools/telemetry/telemetry/core/timeline/process.py b/tools/telemetry/telemetry/core/timeline/process.py
deleted file mode 100644
index 0dbf68aa3e5ecd68fa2d9fe307ed7d513729391c..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/core/timeline/process.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import telemetry.core.timeline.event_container as event_container
-import telemetry.core.timeline.counter as tracing_counter
-import telemetry.core.timeline.thread as tracing_thread
-
-class Process(event_container.TimelineEventContainer):
- ''' The Process represents a single userland process in the trace.
- '''
- def __init__(self, parent, pid):
- super(Process, self).__init__('process %s' % pid, parent)
- self.pid = pid
- self._threads = {}
- self._counters = {}
-
- @property
- def threads(self):
- return self._threads
-
- @property
- def counters(self):
- return self._counters
-
- def IterChildContainers(self):
- for thread in self._threads.itervalues():
- yield thread
- for counter in self._counters.itervalues():
- yield counter
-
- def IterAllSlicesOfName(self, name):
- for thread in self._threads.itervalues():
- for s in thread.IterAllSlicesOfName(name):
- yield s
-
- def IterAllAsyncSlicesOfName(self, name):
- for thread in self._threads.itervalues():
- for s in thread.IterAllAsyncSlicesOfName(name):
- yield s
-
- def IterEventsInThisContainer(self):
- return
- yield # pylint: disable=W0101
-
- def GetOrCreateThread(self, tid):
- thread = self.threads.get(tid, None)
- if thread:
- return thread
- thread = tracing_thread.Thread(self, tid)
- self._threads[tid] = thread
- return thread
-
- def GetCounter(self, category, name):
- counter_id = category + '.' + name
- if counter_id in self.counters:
- return self.counters[counter_id]
- raise ValueError(
- 'Counter %s not found in process with id %s.' % (counter_id,
- self.pid))
- def GetOrCreateCounter(self, category, name):
- try:
- return self.GetCounter(category, name)
- except ValueError:
- ctr = tracing_counter.Counter(self, category, name)
- self._counters[ctr.full_name] = ctr
- return ctr
-
- def AutoCloseOpenSlices(self, max_timestamp, thread_time_bounds):
- for thread in self._threads.itervalues():
- thread.AutoCloseOpenSlices(max_timestamp, thread_time_bounds[thread].max)
-
- def FinalizeImport(self):
- for thread in self._threads.itervalues():
- thread.FinalizeImport()
- for counter in self._counters.itervalues():
- counter.FinalizeImport()

Powered by Google App Engine
This is Rietveld 408576698