133259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck# Copyright 2014 The Chromium Authors. All rights reserved.
233259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck# Use of this source code is governed by a BSD-style license that can be
333259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck# found in the LICENSE file.
433259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
533259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reckimport telemetry.timeline.event as timeline_event
633259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
733259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
833259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reckclass Sample(timeline_event.TimelineEvent):
933259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  """A Sample represents a sample taken at an instant in time
1033259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  plus parameters associated with that sample.
1133259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
1233259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  NOTE: The Sample class implements the same interface as
1333259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  Slice. These must be kept in sync.
1433259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck
1533259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  All time units are stored in milliseconds.
1633259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  """
1733259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck  def __init__(self, parent_thread, category, name, timestamp, args=None):
1833259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck    super(Sample, self).__init__(
1933259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck        category, name, timestamp, 0, args=args)
2033259e44c8229f70ffe0cf3bb5ca9375c4feb2f9John Reck    self.parent_thread = parent_thread
21