export class Profile {

    /**
     *
     * @type {TraceEvent[]}
     */
    traceEvents = [];
    /**
     * If provided displayTimeUnit is a string that specifies in which unit timestamps should be displayed. This supports values of “ms” or “ns”. By default this is value is “ms”
     * @type {string}
     */
    displayTimeUnit = "ms";
    /**
     * If provided systemTraceEvents is a string of Linux ftrace data or Windows ETW trace data. This data must start with # tracer: and adhere to the Linux ftrace format or adhere to Windows ETW format.
     * @type {string}
     */
    systemTraceEvents = "SystemTraceData";

    /**
     *
     * @type {{version: string}}
     */
    otherData = {version: "Meep Profile v1.0"};

    /**
     * If provided, the stackFrames field is a dictionary of stack frames, their ids, and their parents that allows compact representation of stack traces throughout the rest of the trace file. It is optional but sometimes very useful in shrinking file sizes.
     * @type {Object}
     */
    stackFrames = {};

    /**
     *
     * @type {[]}
     */
    samples = [];

    toJSON() {
        return {
            traceEvents: this.traceEvents,
            displayTimeUnit: this.displayTimeUnit,
            systemTraceEvents: this.systemTraceEvents,
            otherData: this.otherData,
            stackFrames: this.stackFrames,
            samples: this.samples
        };
    }


}
