1// Copyright (c) 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5'use strict';
6
7/**
8 * @fileoverview Provides the Sample class.
9 */
10base.exportTo('tracing.model', function() {
11
12  /**
13   * A Sample represents a sample taken at an instant in time
14   * plus parameters associated with that sample.
15   *
16   * NOTE: The Sample class implements the same interface as
17   * Slice. These must be kept in sync.
18   *
19   * All time units are stored in milliseconds.
20   * @constructor
21   */
22  function Sample(category, title, colorId, ts, args) {
23    this.category = category || '';
24    this.title = title;
25    this.colorId = colorId;
26    this.start = ts;
27    this.args = args;
28  }
29
30  Sample.prototype = {
31    selected: false,
32
33    duration: 0,
34
35    get end() {
36      return this.start;
37    }
38  };
39
40  return {
41    Sample: Sample
42  };
43});
44