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

com.newrelic.opentracing.state.TransactionState Maven / Gradle / Ivy

Go to download

New Relic OpenTracing Tracer implementation for instrumenting AWS Lambda functions.

The newest version!
/*
 * Copyright 2020 New Relic Corporation. All rights reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

package com.newrelic.opentracing.state;

import com.newrelic.opentracing.util.DistributedTraceUtil;

public class TransactionState {

    private final String transactionId = DistributedTraceUtil.generateGuid();
    private volatile float transactionDuration = 0f;
    private volatile boolean error = false;
    private volatile String transactionName;

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionName(String transactionType, String functionName) {
        transactionName = transactionType + "/Function/" + functionName;
    }

    public String getTransactionName() {
        return transactionName;
    }

    public float getTransactionDuration() {
        return transactionDuration;
    }

    public void setTransactionDuration(float transactionDuration) {
        this.transactionDuration = transactionDuration;
    }

    public void setError() {
        error = true;
    }

    public boolean hasError() {
        return error;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy