All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openqa.selenium.devtools.v90.memory.model.SamplingProfileNode Maven / Gradle / Ivy

Go to download

Selenium automates browsers. That's it! What you do with that power is entirely up to you.

There is a newer version: 4.0.0-beta-4
Show newest version
package org.openqa.selenium.devtools.v90.memory.model;

import org.openqa.selenium.Beta;
import org.openqa.selenium.json.JsonInput;

/**
 * Heap profile sample.
 */
public class SamplingProfileNode {

    private final java.lang.Number size;

    private final java.lang.Number total;

    private final java.util.List stack;

    public SamplingProfileNode(java.lang.Number size, java.lang.Number total, java.util.List stack) {
        this.size = java.util.Objects.requireNonNull(size, "size is required");
        this.total = java.util.Objects.requireNonNull(total, "total is required");
        this.stack = java.util.Objects.requireNonNull(stack, "stack is required");
    }

    /**
     * Size of the sampled allocation.
     */
    public java.lang.Number getSize() {
        return size;
    }

    /**
     * Total bytes attributed to this sample.
     */
    public java.lang.Number getTotal() {
        return total;
    }

    /**
     * Execution stack at the point of allocation.
     */
    public java.util.List getStack() {
        return stack;
    }

    private static SamplingProfileNode fromJson(JsonInput input) {
        java.lang.Number size = 0;
        java.lang.Number total = 0;
        java.util.List stack = null;
        input.beginObject();
        while (input.hasNext()) {
            switch(input.nextName()) {
                case "size":
                    size = input.nextNumber();
                    break;
                case "total":
                    total = input.nextNumber();
                    break;
                case "stack":
                    stack = input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType());
                    break;
                default:
                    input.skipValue();
                    break;
            }
        }
        input.endObject();
        return new SamplingProfileNode(size, total, stack);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy